texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/info nodes.c


From: Sergey Poznyakoff
Subject: texinfo/info nodes.c
Date: Thu, 10 Feb 2011 09:16:22 +0000

CVSROOT:        /cvsroot/texinfo
Module name:    texinfo
Changes by:     Sergey Poznyakoff <gray>        11/02/10 09:16:21

Modified files:
        info           : nodes.c 

Log message:
        (node_set_body_start): New function.
        (info_get_node_of_file_buffer): Set body_start on the new node.
        (info_node_of_file_buffer_tags): Likewise.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/info/nodes.c?cvsroot=texinfo&r1=1.15&r2=1.16

Patches:
Index: nodes.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/info/nodes.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- nodes.c     7 Oct 2010 12:24:07 -0000       1.15
+++ nodes.c     10 Feb 2011 09:16:21 -0000      1.16
@@ -1,5 +1,5 @@
 /* nodes.c -- how to get an Info file and node.
-   $Id: nodes.c,v 1.15 2010/10/07 12:24:07 gray Exp $
+   $Id: nodes.c,v 1.16 2011/02/10 09:16:21 gray Exp $
 
    Copyright (C) 1993, 1998, 1999, 2000, 2002, 2003, 2004, 2006, 2007,
    2008, 2009 Free Software Foundation, Inc.
@@ -135,6 +135,16 @@
   return node;
 }
 
+static void
+node_set_body_start (NODE *node)
+{
+  int n = skip_node_separator (node->contents);
+  node->body_start = strcspn(node->contents + n, "\n");
+  node->body_start += n;
+  if (node->contents[++node->body_start] == '\n')
+    ++node->body_start;
+}
+
 /* 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
@@ -174,6 +184,7 @@
       node->nodelen = file_buffer->filesize;
       node->flags = 0;
       node->display_pos = 0;
+      node_set_body_start (node);
     }
 #if defined (HANDLE_MAN_PAGES)
   /* If the file buffer is the magic one associated with manpages, call
@@ -929,7 +940,6 @@
   return node;
 }
 
-
 /* Return the node from FILE_BUFFER which matches NODENAME by searching
    the tags table in FILE_BUFFER, or NULL.  */
 static NODE *
@@ -971,6 +981,7 @@
        node->contents    = subfile->contents + tag->nodestart;
        node->display_pos = 0;
        node->flags       = 0;
+       node_set_body_start (node);
        
        if (file_buffer->flags & N_HasTagsTable)
          {



reply via email to

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