cppfiles.c (stack_file): Correctly pass return_at_eof parameter to cpp_push_buffer.
authorPer Bothner <bothner@pbothner.com>
Thu, 21 Aug 2003 15:57:51 +0000 (15:57 +0000)
committerPer Bothner <bothner@gcc.gnu.org>
Thu, 21 Aug 2003 15:57:51 +0000 (08:57 -0700)
* cppfiles.c (stack_file):  Correctly pass return_at_eof parameter
to cpp_push_buffer.
* cpplex.c (_cpp_get_fresh_line):  Don't buffer->prev - handled
by return_at_eof check.  Always call _cpp_pop_buffer at end.

From-SVN: r70646

gcc/ChangeLog
gcc/cppfiles.c
gcc/cpplex.c

index 6d8de7d..d572aa4 100644 (file)
@@ -1,3 +1,10 @@
+2003-08-21  Per Bothner  <bothner@pbothner.com>
+
+       * cppfiles.c (stack_file):  Correctly pass return_at_eof parameter
+       to cpp_push_buffer.
+       * cpplex.c (_cpp_get_fresh_line):  Don't buffer->prev - handled
+       by return_at_eof check.  Always call _cpp_pop_buffer at end.
+
 2003-08-21  Kazu Hirata  <kazu@cs.umass.edu>
 
        PR target/11805
index 04f067d..a4edd5d 100644 (file)
@@ -615,7 +615,8 @@ stack_file (cpp_reader *pfile, _cpp_file *file, bool import)
 
   /* Stack the buffer.  */
   buffer = cpp_push_buffer (pfile, file->buffer, file->st.st_size,
-                           CPP_OPTION (pfile, preprocessed), 0);
+                           CPP_OPTION (pfile, preprocessed),
+                           ! pfile->buffer);
   buffer->file = file;
 
   /* Initialize controlling macro state.  */
index c3ef88d..1c00bdd 100644 (file)
@@ -719,9 +719,6 @@ _cpp_get_fresh_line (cpp_reader *pfile)
                               "no newline at end of file");
        }
  
-      if (!buffer->prev)
-       return false;
-
       if (buffer->return_at_eof)
        {
          _cpp_pop_buffer (pfile);