texinfo-commits
[Top][All Lists]
Advanced

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

[6261] info bug fixes


From: Gavin D. Smith
Subject: [6261] info bug fixes
Date: Mon, 11 May 2015 16:11:10 +0000

Revision: 6261
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6261
Author:   gavin
Date:     2015-05-11 16:11:09 +0000 (Mon, 11 May 2015)
Log Message:
-----------
info bug fixes

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/info.c
    trunk/info/nodes.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-05-10 17:29:27 UTC (rev 6260)
+++ trunk/ChangeLog     2015-05-11 16:11:09 UTC (rev 6261)
@@ -1,3 +1,12 @@
+2015-05-11  Gavin Smith  <address@hidden>
+
+       * info/nodes.c (convert_eols): Do pointer arithmetic before 
+       reallocating.
+       (find_node_from_tag) <EOL conversion>: Also update 'node' field 
+       of each window as well as the histories.
+       * info/info.c (add_initial_nodes) <inexact menu following>: 
+       Always free reached node.
+
 2015-05-10  Eli Zaretskii  <address@hidden>
 
        * util/texindex.bat: New file.

Modified: trunk/info/info.c
===================================================================
--- trunk/info/info.c   2015-05-10 17:29:27 UTC (rev 6260)
+++ trunk/info/info.c   2015-05-11 16:11:09 UTC (rev 6261)
@@ -468,13 +468,16 @@
                                                       0);
           free (*error); *error = 0;
           node_via_menus = info_follow_menus (initial_node, argv, error, 0);
-          if (node_via_menus && (argc >= 2 || !*error))
+          if (node_via_menus)
             {
-              argv += argc; argc = 0;
+              if (argc >= 2 || !*error)
+                {
+                  argv += argc; argc = 0;
 
-              info_reference_free (ref_list[0]);
-              ref_list[0] = info_new_reference (node_via_menus->fullpath,
-                                                node_via_menus->nodename);
+                  info_reference_free (ref_list[0]);
+                  ref_list[0] = info_new_reference (node_via_menus->fullpath,
+                                                    node_via_menus->nodename);
+                }
               free_history_node (node_via_menus);
             }
         }

Modified: trunk/info/nodes.c
===================================================================
--- trunk/info/nodes.c  2015-05-10 17:29:27 UTC (rev 6260)
+++ trunk/info/nodes.c  2015-05-11 16:11:09 UTC (rev 6261)
@@ -1114,11 +1114,11 @@
     }
   *d = '\0';
 
+  destination->filesize = d - destination->contents;
   /* EOL conversion can shrink the text quite a bit.  We don't
      want to waste storage.  */
   destination->contents = xrealloc (destination->contents,
                                     d - destination->contents + 1);
-  destination->filesize = d - destination->contents;
 }
 
 /* Magic number that RMS used to decide how much a tags table pointer could
@@ -1251,6 +1251,7 @@
       if (!w->hist)
         continue;
 
+      w->node = 0;
       for (h = w->hist; *h; h++)
         {
           NODE *n = (*h)->node;;
@@ -1273,6 +1274,8 @@
                 }
             }
         }
+      if (h > w->hist)
+        w->node = (*(h - 1))->node;
     }
 
   if (success)




reply via email to

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