texinfo-commits
[Top][All Lists]
Advanced

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

[7012] only look in 1st line for info keywords


From: Gavin D. Smith
Subject: [7012] only look in 1st line for info keywords
Date: Sat, 13 Feb 2016 21:03:51 +0000

Revision: 7012
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7012
Author:   gavin
Date:     2016-02-13 21:02:39 +0000 (Sat, 13 Feb 2016)
Log Message:
-----------
only look in 1st line for info keywords

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-02-13 18:41:58 UTC (rev 7011)
+++ trunk/ChangeLog     2016-02-13 21:02:39 UTC (rev 7012)
@@ -1,5 +1,10 @@
 2016-02-13  Gavin Smith  <address@hidden>
 
+       * info/window.c (calculate_line_starts): Only look in first line 
+       of node for Info keywords.
+
+2016-02-13  Gavin Smith  <address@hidden>
+
        * info/info-utils.c (nodeline_print): Move to info/window.c.
        (parse_top_node_line): Remove code altering start of node 
        depending on value of nodeline_print.

Modified: trunk/info/nodes.h
===================================================================
--- trunk/info/nodes.h  2016-02-13 18:41:58 UTC (rev 7011)
+++ trunk/info/nodes.h  2016-02-13 21:02:39 UTC (rev 7012)
@@ -139,38 +139,38 @@
    already, or it may not.  If it does not already appear, find the file,
    and add it to the list of loaded files.  If the file cannot be found,
    return a NULL FILE_BUFFER *. */
-extern FILE_BUFFER *info_find_file (char *filename);
+FILE_BUFFER *info_find_file (char *filename);
 
 FILE_BUFFER *info_find_subfile (char *filename);
 
 TAG *info_create_tag (void);
 
 /* Return a pointer to a new NODE structure. */
-extern NODE *info_create_node (void);
+NODE *info_create_node (void);
 
 /* Return a pointer to a NODE structure for the Info node (FILENAME)NODENAME.
    FILENAME can be passed as NULL, in which case the filename of "dir" is used.
    NODENAME can be passed as NULL, in which case the nodename of "Top" is used.
    
    If the node cannot be found, return a NULL pointer. */
-extern NODE *info_get_node (char *filename, char *nodename);
+NODE *info_get_node (char *filename, char *nodename);
 
-extern NODE *info_get_node_with_defaults (char *filename, char *nodename,
+NODE *info_get_node_with_defaults (char *filename, char *nodename,
                                           NODE *defaults);
 
-extern NODE *info_node_of_tag (FILE_BUFFER *fb, TAG **tag_ptr);
-extern NODE *info_node_of_tag_fast (FILE_BUFFER *fb, TAG **tag_ptr);
+NODE *info_node_of_tag (FILE_BUFFER *fb, TAG **tag_ptr);
+NODE *info_node_of_tag_fast (FILE_BUFFER *fb, TAG **tag_ptr);
 
 /* Return a pointer to a NODE structure for the Info node NODENAME in
    FILE_BUFFER.  NODENAME can be passed as NULL, in which case the
    nodename of "Top" is used.  If the node cannot be found, return a
    NULL pointer. */
-extern NODE *info_get_node_of_file_buffer (FILE_BUFFER *file_buffer,
+NODE *info_get_node_of_file_buffer (FILE_BUFFER *file_buffer,
                                            char *nodename);
 
 /* Grovel FILE_BUFFER->contents finding tags and nodes, and filling in the
    various slots.  This can also be used to rebuild a tag or node table. */
-extern void build_tags_and_nodes (FILE_BUFFER *file_buffer);
+void build_tags_and_nodes (FILE_BUFFER *file_buffer);
 
 void free_history_node (NODE *n);
 
@@ -178,15 +178,15 @@
 extern char *info_recent_file_error;
 
 /* Create a new, empty file buffer. */
-extern FILE_BUFFER *make_file_buffer (void);
+FILE_BUFFER *make_file_buffer (void);
 
 /* Non-zero means don't try to be smart when searching for nodes.  */
 extern int strict_node_location_p;
 
 
 /* Found in dir.c */
-extern NODE *get_dir_node (void);
-extern REFERENCE *lookup_dir_entry (char *label, int sloppy);
-extern REFERENCE *dir_entry_of_infodir (char *label, char *searchdir);
+NODE *get_dir_node (void);
+REFERENCE *lookup_dir_entry (char *label, int sloppy);
+REFERENCE *dir_entry_of_infodir (char *label, char *searchdir);
 
 #endif /* not NODES_H */

Modified: trunk/info/window.c
===================================================================
--- trunk/info/window.c 2016-02-13 18:41:58 UTC (rev 7011)
+++ trunk/info/window.c 2016-02-13 21:02:39 UTC (rev 7012)
@@ -1183,22 +1183,24 @@
   if (nodeline_print != PRINT_NODELINE
       && !memcmp (win->node->contents, "File:", strlen ("File:")))
     {
-      char *s;
-      if (nodeline_print == NO_NODELINE)
+      char *s = strchr (win->node->contents, '\n');
+      if (s && nodeline_print == NO_NODELINE)
         {
-          s = strchr (win->node->contents, '\n');
-          if (s)
-            pl_start = s - win->node->contents + 1;
+          pl_start = s - win->node->contents + 1;
         }
-      else if (nodeline_print == NODELINE_POINTERS_ONLY)
+      else if (s && nodeline_print == NODELINE_POINTERS_ONLY)
         {
-          s = strstr (win->node->contents, "Next: ");
-          if (!s)
-            s = strstr (win->node->contents, "Prev: ");
-          if (!s)
-            s = strstr (win->node->contents, "Up: ");
-          if (s)
-            pl_start = s - win->node->contents;
+          char *s2;
+          char saved = *s;
+          *s = '\0';
+          s2 = strstr (win->node->contents, "Next: ");
+          if (!s2)
+            s2 = strstr (win->node->contents, "Prev: ");
+          if (!s2)
+            s2 = strstr (win->node->contents, "Up: ");
+          if (s2)
+            pl_start = s2 - win->node->contents;
+          *s = saved;
         }
     }
 




reply via email to

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