m4-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changes to m4/src/Attic/input.c,v [branch-1_4]


From: Eric Blake
Subject: Changes to m4/src/Attic/input.c,v [branch-1_4]
Date: Mon, 04 Sep 2006 13:35:12 +0000

CVSROOT:        /sources/m4
Module name:    m4
Branch:         branch-1_4
Changes by:     Eric Blake <ericb>      06/09/04 13:35:10

Index: src/input.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/input.c,v
retrieving revision 1.1.1.1.2.21
retrieving revision 1.1.1.1.2.22
diff -u -b -r1.1.1.1.2.21 -r1.1.1.1.2.22
--- src/input.c 23 Aug 2006 11:30:11 -0000      1.1.1.1.2.21
+++ src/input.c 4 Sep 2006 13:35:10 -0000       1.1.1.1.2.22
@@ -455,8 +455,12 @@
                    "INTERNAL ERROR: input stack botch in peek_input ()"));
          abort ();
        }
-      /* End of input source --- pop one level.  */
+      /* End of current input source --- pop one level if another
+        level still exists.  */
+      if (isp->prev != NULL)
       pop_input ();
+      else
+       return CHAR_EOF;
     }
 }
 
@@ -783,18 +787,20 @@
   obstack_1grow (&token_stack, '\0');
   token_bottom = obstack_finish (&token_stack);
 
+ /* Can't consume character until after CHAR_MACRO is handled.  */
   ch = peek_input ();
   if (ch == CHAR_EOF)
     {
 #ifdef DEBUG_INPUT
       fprintf (stderr, "next_token -> EOF\n");
 #endif
+      next_char ();
       return TOKEN_EOF;
     }
   if (ch == CHAR_MACRO)
     {
       init_macro_token (td);
-      (void) next_char ();
+      next_char ();
 #ifdef DEBUG_INPUT
       fprintf (stderr, "next_token -> MACDEF (%s)\n",
               find_builtin_by_addr (TOKEN_DATA_FUNC (td))->name);
@@ -802,7 +808,7 @@
       return TOKEN_MACDEF;
     }
 
-  (void) next_char ();
+  next_char (); /* Consume character we already peeked at.  */
   if (MATCH (ch, bcomm.string, TRUE))
     {
       obstack_grow (&token_stack, bcomm.string, bcomm.length);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]