texinfo-commits
[Top][All Lists]
Advanced

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

[7515] parsetexi values


From: gavinsmith0123
Subject: [7515] parsetexi values
Date: Fri, 18 Nov 2016 07:18:35 +0000 (UTC)

Revision: 7515
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7515
Author:   gavin
Date:     2016-11-18 07:18:35 +0000 (Fri, 18 Nov 2016)
Log Message:
-----------
parsetexi values

Modified Paths:
--------------
    trunk/tp/parsetexi/handle_commands.c
    trunk/tp/parsetexi/parser.c

Modified: trunk/tp/parsetexi/handle_commands.c
===================================================================
--- trunk/tp/parsetexi/handle_commands.c        2016-11-17 19:35:06 UTC (rev 
7514)
+++ trunk/tp/parsetexi/handle_commands.c        2016-11-18 07:18:35 UTC (rev 
7515)
@@ -691,6 +691,7 @@
           if (spaces > 0)
             {
               char saved = line[spaces];
+              line[spaces] = '\0';
               current = merge_text (current, line);
               line[spaces] = saved;
               line += spaces;

Modified: trunk/tp/parsetexi/parser.c
===================================================================
--- trunk/tp/parsetexi/parser.c 2016-11-17 19:35:06 UTC (rev 7514)
+++ trunk/tp/parsetexi/parser.c 2016-11-18 07:18:35 UTC (rev 7515)
@@ -974,6 +974,31 @@
   /* Skip empty lines.  If we reach the end of input, continue in case there
      is an @include. */
 
+  /* There are cases when we need more input, but we don't want to
+     get it in the top-level loop in parse_texi - this is mostly
+     (always?) when we don't want to start a new, empty line, and
+     need to get more from the current, incomplete line of input. */
+  // 3878
+  while (*line == '\0')
+    {
+      static char *allocated_text;
+      debug ("EMPTY TEXT");
+
+      /* Each place we supply Texinfo input we store the supplied
+         input in a static variable like allocated_text, to prevent
+         memory leaks.  */
+      free (allocated_text);
+      line = allocated_text = next_text ();
+
+      if (!line)
+        {
+          /* TODO: Can this only happen at end of file? */
+          current = end_line (current);
+          retval = GET_A_NEW_LINE;
+          goto funexit;
+        }
+    }
+
   if (*line == '@')
     {
       line_after_command = line + 1;
@@ -1021,31 +1046,6 @@
         cmd = command_data(cmd).data;
     }
 
-  /* There are cases when we need more input, but we don't want to
-     get it in the top-level loop in parse_texi - this is mostly
-     (always?) when we don't want to start a new, empty line, and
-     need to get more from the current, incomplete line of input. */
-  // 3878
-  while (*line == '\0')
-    {
-      static char *allocated_text;
-      debug ("EMPTY TEXT");
-
-      /* Each place we supply Texinfo input we store the supplied
-         input in a static variable like allocated_text, to prevent
-         memory leaks.  */
-      free (allocated_text);
-      line = allocated_text = next_text ();
-
-      if (!line)
-        {
-          /* TODO: Can this only happen at end of file? */
-          current = end_line (current);
-          retval = GET_A_NEW_LINE;
-          goto funexit;
-        }
-    }
-
   /* Handle user-defined macros before anything else because their expansion 
      may lead to changes in the line. */
   if (cmd && (command_data(cmd).flags & CF_MACRO)) // 3894
@@ -1184,6 +1184,7 @@
       if (cmd == CM_value)
         {
           char *arg_start;
+          line += strspn (line, whitespace_chars);
           if (*line != '{')
             goto value_invalid;
 




reply via email to

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