diff options
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r-- | gcc/cpplex.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c index 27ef0ee..9912aac 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -747,6 +747,8 @@ _cpp_lex_token (cpp_reader *pfile) bool _cpp_get_fresh_line (cpp_reader *pfile) { + int return_at_eof; + /* We can't get a new line until we leave the current directive. */ if (pfile->state.in_directive) return false; @@ -779,9 +781,10 @@ _cpp_get_fresh_line (cpp_reader *pfile) CPP_BUF_COLUMN (buffer, buffer->cur), "no newline at end of file"); } - + + return_at_eof = buffer->return_at_eof; _cpp_pop_buffer (pfile); - if (pfile->buffer == NULL) + if (pfile->buffer == NULL || return_at_eof) return false; } } |