texinfo-commits
[Top][All Lists]
Advanced

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

[6182] info small fixes


From: Gavin D. Smith
Subject: [6182] info small fixes
Date: Sat, 07 Mar 2015 19:36:02 +0000

Revision: 6182
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6182
Author:   gavin
Date:     2015-03-07 19:36:01 +0000 (Sat, 07 Mar 2015)
Log Message:
-----------
info small fixes

Modified Paths:
--------------
    trunk/info/dir.c
    trunk/info/info-utils.c
    trunk/info/man.c

Modified: trunk/info/dir.c
===================================================================
--- trunk/info/dir.c    2015-03-07 19:28:54 UTC (rev 6181)
+++ trunk/info/dir.c    2015-03-07 19:36:01 UTC (rev 6182)
@@ -291,10 +291,11 @@
       dir_node = info_get_node (dir_fullpath, "Top");
       free (dir_fullpath);
       entry = info_get_menu_entry_by_label (dir_node, label, 1);
-      if (!entry)
+      if (!entry || !entry->filename)
         {
           free_history_node (dir_node);
           continue;
+          /* A dir entry with no filename is unlikely, but not impossible. */
         }
 
       entry = info_copy_reference (entry);

Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c     2015-03-07 19:28:54 UTC (rev 6181)
+++ trunk/info/info-utils.c     2015-03-07 19:36:01 UTC (rev 6182)
@@ -1477,9 +1477,9 @@
       int line_len;
       int length = 0; /* Length of specification */
 
-      length = strspn (inptr, " ");
+      length = skip_whitespace (inptr);
       length += read_bracketed_filename (inptr + length, &entry->filename);
-      length += skip_whitespace (inptr + length);
+      length += strspn (inptr + length, " ");
 
       /* Get the node name. */
       length += read_quoted_string (inptr + length, ",.\t\n", 2, 

Modified: trunk/info/man.c
===================================================================
--- trunk/info/man.c    2015-03-07 19:28:54 UTC (rev 6181)
+++ trunk/info/man.c    2015-03-07 19:36:01 UTC (rev 6182)
@@ -100,11 +100,10 @@
       if (!preprocess_nodes_p)
         {
           char *header;
-          asprintf (&header, "%s %s,  %s %s,  %s (dir)\n\n",
+          hlen = asprintf (&header, "%s %s,  %s %s,  %s (dir)\n\n",
                    INFO_FILE_LABEL, MANPAGE_FILE_BUFFER_NAME,
                    INFO_NODE_LABEL, pagename,
                    INFO_UP_LABEL);
-          hlen = strlen (header);
 
           node->contents = xcalloc (1, hlen + plen + 1);
           memcpy (node->contents, header, hlen);




reply via email to

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