texinfo-commits
[Top][All Lists]
Advanced

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

[5810] duplicate nodenames for internal nodes


From: Gavin D. Smith
Subject: [5810] duplicate nodenames for internal nodes
Date: Mon, 08 Sep 2014 15:12:05 +0000

Revision: 5810
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5810
Author:   gavin
Date:     2014-09-08 15:12:03 +0000 (Mon, 08 Sep 2014)
Log Message:
-----------
duplicate nodenames for internal nodes

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/echo-area.c
    trunk/info/footnotes.c
    trunk/info/indices.c
    trunk/info/info-utils.c
    trunk/info/infodoc.c
    trunk/info/nodemenu.c
    trunk/info/session.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-09-08 13:54:38 UTC (rev 5809)
+++ trunk/ChangeLog     2014-09-08 15:12:03 UTC (rev 5810)
@@ -1,5 +1,26 @@
 2014-09-08  Gavin Smith  <address@hidden>
 
+       * info/session.c (free_history_node): Free 'nodename' field for
+       internal nodes.
+       (info_split_window): Copy 'nodename' field for new internal nodes.
+
+       * info/echo-area.c (ea_possible_completions),
+       * info/footnotes.c (make_footnotes_node),
+       * info/indices.c (info_index_apropos),
+       * info/nodemenu.c (list_visited_nodes): Duplicate 'nodename' field
+       of new node.
+
+       * info/footnotes.c (FOOTNOTE_HEADER_FORMAT): Removed.
+       (make_footnotes_node): Don't call name_internal_node.
+
+       * info/indices.c (info_index_apropos),
+       * info/infodoc.c (create_internal_info_help_node): Don't clear
+       N_IsInternal flag on new node.
+
+       * info/info-utils.c (info_copy_references): Check if argument is null.
+
+2014-09-08  Gavin Smith  <address@hidden>
+
        * info/indices.c (create_virtindex_file_buffer): Deleted.
        (create_virtindex_node): Merged into caller in info_virtual_index.
        (info_virtual_index): Don't create a FILE_BUFFER to hold generated

Modified: trunk/info/echo-area.c
===================================================================
--- trunk/info/echo-area.c      2014-09-08 13:54:38 UTC (rev 5809)
+++ trunk/info/echo-area.c      2014-09-08 15:12:03 UTC (rev 5810)
@@ -1031,7 +1031,7 @@
 
         temp = text_buffer_to_node (&message);
         add_gcable_pointer (temp->contents);
-        name_internal_node (temp, compwin_name);
+        name_internal_node (temp, xstrdup (compwin_name));
         possible_completions_output_node = temp;
       }
 

Modified: trunk/info/footnotes.c
===================================================================
--- trunk/info/footnotes.c      2014-09-08 13:54:38 UTC (rev 5809)
+++ trunk/info/footnotes.c      2014-09-08 15:12:03 UTC (rev 5810)
@@ -26,11 +26,6 @@
 
 static char *footnote_nodename = "*Footnotes*";
 
-NODE * make_footnotes_node (NODE *node);
-
-#define FOOTNOTE_HEADER_FORMAT \
-   "*** Footnotes appearing in the node '%s' ***\n"
-
 /* Find the window currently showing footnotes. */
 static WINDOW *
 find_footnotes_window (void)
@@ -123,9 +118,9 @@
     char *header;
     long text_start = fn_start;
 
-    header = xmalloc
-      (1 + strlen (node->nodename) + strlen (FOOTNOTE_HEADER_FORMAT));
-    sprintf (header, FOOTNOTE_HEADER_FORMAT, node->nodename);
+    asprintf (&header,
+              "*** Footnotes appearing in the node '%s' ***\n",
+              node->nodename);
 
     /* Move the start of the displayed text to right after the first line.
        This effectively skips either "---- footno...", or "File: foo...". */
@@ -162,7 +157,8 @@
         }
     }
 
-    name_internal_node (result, footnote_nodename);
+    result->nodename = xstrdup (footnote_nodename);
+    result->flags |= N_IsInternal;
 
     /* Needed in case the user follows a reference in the footnotes window. */
     result->fullpath = fn_node->fullpath;

Modified: trunk/info/indices.c
===================================================================
--- trunk/info/indices.c        2014-09-08 13:54:38 UTC (rev 5809)
+++ trunk/info/indices.c        2014-09-08 15:12:03 UTC (rev 5810)
@@ -635,13 +635,8 @@
       scan_node_contents (0, &apropos_node);
 
       add_gcable_pointer (apropos_node->contents);
-      name_internal_node (apropos_node, apropos_list_nodename);
+      name_internal_node (apropos_node, xstrdup (apropos_list_nodename));
 
-      /* Even though this is an internal node, we don't want the window
-         system to treat it specially.  So we turn off the internalness
-         of it here. */
-      apropos_node->flags &= ~N_IsInternal;
-
       /* Find/Create a window to contain this node. */
       {
         WINDOW *new;

Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c     2014-09-08 13:54:38 UTC (rev 5809)
+++ trunk/info/info-utils.c     2014-09-08 15:12:03 UTC (rev 5810)
@@ -327,6 +327,9 @@
   REFERENCE **result;
   int size;
 
+  if (!ref1)
+    return 0;
+
   /* Get the total size of the slots that we will need. */
   for (i = 0; ref1[i]; i++);
   size = i;

Modified: trunk/info/infodoc.c
===================================================================
--- trunk/info/infodoc.c        2014-09-08 13:54:38 UTC (rev 5809)
+++ trunk/info/infodoc.c        2014-09-08 15:12:03 UTC (rev 5810)
@@ -281,12 +281,7 @@
   add_gcable_pointer (internal_info_help_node->contents);
 #endif
 
-  name_internal_node (internal_info_help_node, info_help_nodename);
-
-  /* Even though this is an internal node, we don't want the window
-     system to treat it specially.  So we turn off the internalness
-     of it here. */
-  internal_info_help_node->flags &= ~N_IsInternal;
+  name_internal_node (internal_info_help_node, xstrdup (info_help_nodename));
 }
 
 /* Return a window which is the window showing help in this Info. */

Modified: trunk/info/nodemenu.c
===================================================================
--- trunk/info/nodemenu.c       2014-09-08 13:54:38 UTC (rev 5809)
+++ trunk/info/nodemenu.c       2014-09-08 15:12:03 UTC (rev 5810)
@@ -240,7 +240,7 @@
   /* Lines do not wrap in this window. */
   new->flags |= W_NoWrap;
   node = get_visited_nodes ();
-  name_internal_node (node, nodemenu_nodename);
+  name_internal_node (node, xstrdup (nodemenu_nodename));
 
   info_set_node_of_window (new, node);
   active_window = new;

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-09-08 13:54:38 UTC (rev 5809)
+++ trunk/info/session.c        2014-09-08 15:12:03 UTC (rev 5810)
@@ -756,10 +756,13 @@
 static void
 free_history_node (NODE *n)
 {
-  /* References of internal nodes are not stored anywhere else.  The
-     contents fields were recorded with add_gcable_pointer. */
   if (n->flags & N_IsInternal)
-    info_free_references (n->references);
+    {
+      /* These fields are not stored anywhere else.  The
+         contents field was recorded with add_gcable_pointer. */
+      info_free_references (n->references);
+      free (n->nodename);
+    }
 
   free (n);
 }
@@ -1641,11 +1644,13 @@
       NODE *copy = xmalloc (sizeof (NODE));
       *copy = *window->node; /* Field-by-field copy of structure. */
 
-      /* References in internal nodes are not stored in a tag table.  This
-         allows us to free internal nodes without checking if their
-         references are shared by other NODE objects. */
+      /* This allows us to free internal nodes without checking if
+         these fields are shared by NODE objects in other windows. */
       if (copy->flags & N_IsInternal)
-        copy->references = info_copy_references (copy->references);
+        {
+          copy->references = info_copy_references (copy->references);
+          copy->nodename = xstrdup (copy->nodename);
+        }
 
       info_set_node_of_window (split, copy);
       /* Make sure point still appears in the active window. */




reply via email to

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