texinfo-commits
[Top][All Lists]
Advanced

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

[8407] parsetexi update


From: gavinsmith0123
Subject: [8407] parsetexi update
Date: Thu, 25 Oct 2018 14:53:56 -0400 (EDT)

Revision: 8407
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8407
Author:   gavin
Date:     2018-10-25 14:53:56 -0400 (Thu, 25 Oct 2018)
Log Message:
-----------
parsetexi update

Modified Paths:
--------------
    trunk/tp/Texinfo/XS/parsetexi/input.c

Modified: trunk/tp/Texinfo/XS/parsetexi/input.c
===================================================================
--- trunk/tp/Texinfo/XS/parsetexi/input.c       2018-10-25 18:26:18 UTC (rev 
8406)
+++ trunk/tp/Texinfo/XS/parsetexi/input.c       2018-10-25 18:53:56 UTC (rev 
8407)
@@ -254,6 +254,8 @@
   return 0;
 }
 
+char *save_string (char *string);
+
 /* Check for a #line directive.
    FIXME: Really shouldn't have to be checking whether we are inside
    @verb etc. all the way down in here.  Then we could avoid passing
@@ -293,13 +295,15 @@
   p += strspn (p, " \t");
   if (*p == '"')
     {
+      char c;
       p++;
       q = strchr (p, '"');
       if (!q)
         return 0;
-      filename = malloc (q - p + 1);
-      memcpy (filename, p, q - p);
-      filename[q - p] = '\0';
+      c = *q;
+      *q = 0;
+      filename = save_string (p);
+      *q = c;
       p = q + 1;
       p += strspn (p, " \t");
 
@@ -312,7 +316,6 @@
   line_nr->line_nr = line_no;
   if (filename)
     {
-      // free (line_nr->file_name); // FIXME: could still be referenced
       line_nr->file_name = filename;
     }
   return 1;




reply via email to

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