* fix-header.c (cb_file_change): Likewise.
* c-ppoutput.c (pp_file_change): Likewise.
+ * cpplex.c (_cpp_get_fresh_line): Revert my no-longer-needed
+ 08-28 change, since we're never called with a NULL buffer.
+ (_cpp_lex_direct): Likewise.
+ * cpptrad.c (_cpp_read_logical_line_trad): Likewise.
+ Return false if buffer is NULL at end.
+
+ * cpplex.c (_cpp_get_fresh_line): Return value now just depends on
+ whether pfile->buffer is NULL after pop, ignoring return_at_eof.
+
2003-10-01 Zack Weinberg <zack@codesourcery.com>
* target.h (init_libfuncs): New hook.
{
cpp_buffer *buffer = pfile->buffer;
- if (buffer == NULL)
- return false;
-
if (!buffer->need_line)
return true;
"no newline at end of file");
}
- if (buffer->return_at_eof)
- {
- _cpp_pop_buffer (pfile);
- return false;
- }
-
_cpp_pop_buffer (pfile);
+ if (pfile->buffer == NULL)
+ return false;
}
}
fresh_line:
result->flags = 0;
buffer = pfile->buffer;
- if (buffer == NULL || buffer->need_line)
+ if (buffer->need_line)
{
if (!_cpp_get_fresh_line (pfile))
{
result->flags = BOL;
if (pfile->state.parsing_args == 2)
result->flags |= PREV_WHITE;
- buffer = pfile->buffer;
}
+ buffer = pfile->buffer;
update_tokens_line:
result->line = pfile->line;
{
do
{
- if ((pfile->buffer == NULL || pfile->buffer->need_line)
- && !_cpp_get_fresh_line (pfile))
+ if (pfile->buffer->need_line && !_cpp_get_fresh_line (pfile))
return false;
}
while (!_cpp_scan_out_logical_line (pfile, NULL) || pfile->state.skipping);
- return true;
+ return pfile->buffer != NULL;
}
/* Set up state for finding the opening '(' of a function-like