texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * info/nodes.c (DEFAULT_INFO_TAG_TABLE_RANGE) (bu


From: Patrice Dumas
Subject: branch master updated: * info/nodes.c (DEFAULT_INFO_TAG_TABLE_RANGE) (build_tags_and_nodes): rename DEFAULT_INFO_LOCAL_VAR_RANGE as DEFAULT_INFO_TAG_TABLE_RANGE. Avoid setting search binding end or start to negative numbers, even temporarily, using DEFAULT_INFO_TAG_TABLE_RANGE as in get_file_character_encoding.
Date: Mon, 07 Oct 2024 18:08:47 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new c4ecdcc90a * info/nodes.c (DEFAULT_INFO_TAG_TABLE_RANGE) 
(build_tags_and_nodes): rename DEFAULT_INFO_LOCAL_VAR_RANGE as 
DEFAULT_INFO_TAG_TABLE_RANGE.  Avoid setting search binding end or start to 
negative numbers, even temporarily, using DEFAULT_INFO_TAG_TABLE_RANGE as in 
get_file_character_encoding.
c4ecdcc90a is described below

commit c4ecdcc90afab26f092cb069e5a327a7ec09eedf
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Oct 8 00:08:38 2024 +0200

    * info/nodes.c (DEFAULT_INFO_TAG_TABLE_RANGE)
    (build_tags_and_nodes): rename DEFAULT_INFO_LOCAL_VAR_RANGE as
    DEFAULT_INFO_TAG_TABLE_RANGE.  Avoid setting search binding end or
    start to negative numbers, even temporarily, using
    DEFAULT_INFO_TAG_TABLE_RANGE as in get_file_character_encoding.
---
 ChangeLog    |  8 ++++++++
 info/nodes.c | 13 +++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5ef10e4c27..2a79dbc848 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-10-07  Patrice Dumas  <pertusus@free.fr>
+
+       * info/nodes.c (DEFAULT_INFO_TAG_TABLE_RANGE)
+       (build_tags_and_nodes): rename DEFAULT_INFO_LOCAL_VAR_RANGE as
+       DEFAULT_INFO_TAG_TABLE_RANGE.  Avoid setting search binding end or
+       start to negative numbers, even temporarily, using
+       DEFAULT_INFO_TAG_TABLE_RANGE as in get_file_character_encoding.
+
 2024-10-07  Patrice Dumas  <pertusus@free.fr>
 
        * info/nodes.c (info_create_tag), info/nodes.h (TAG): set TAG
diff --git a/info/nodes.c b/info/nodes.c
index 84b4de3a42..976fbc0d66 100644
--- a/info/nodes.c
+++ b/info/nodes.c
@@ -53,6 +53,8 @@ static void get_tags_of_indirect_tags_table (FILE_BUFFER 
*file_buffer,
 static void free_file_buffer_tags (FILE_BUFFER *file_buffer);
 static void free_info_tag (TAG *tag);
 
+#define DEFAULT_INFO_TAG_TABLE_RANGE 1000
+
 /* 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. */
 void
@@ -68,9 +70,10 @@ build_tags_and_nodes (FILE_BUFFER *file_buffer)
   /* See if there is a tags table in this info file. */
   binding.buffer = file_buffer->contents;
   binding.start = file_buffer->filesize;
-  binding.end = binding.start - 1000;
-  if (binding.end < 0)
+  if (binding.start < DEFAULT_INFO_TAG_TABLE_RANGE)
     binding.end = 0;
+  else
+    binding.end = binding.start - DEFAULT_INFO_TAG_TABLE_RANGE;
   binding.flags = S_FoldCase;
 
   position = find_file_section (&binding, TAGS_TABLE_END_LABEL);
@@ -764,8 +767,6 @@ info_load_file (char *fullpath, int is_subfile)
   return file_buffer;
 }
 
-#define DEFAULT_INFO_LOCAL_VAR_RANGE 1000
-
 /* Look for local variables section in FB and set encoding */
 static void
 get_file_character_encoding (FILE_BUFFER *fb)
@@ -780,10 +781,10 @@ get_file_character_encoding (FILE_BUFFER *fb)
   /* See if there is a local variables section in this info file. */
   binding.buffer = fb->contents;
   binding.start = fb->filesize;
-  if (binding.start < DEFAULT_INFO_LOCAL_VAR_RANGE)
+  if (binding.start < DEFAULT_INFO_TAG_TABLE_RANGE)
     binding.end = 0;
   else
-    binding.end = binding.start - DEFAULT_INFO_LOCAL_VAR_RANGE;
+    binding.end = binding.start - DEFAULT_INFO_TAG_TABLE_RANGE;
   binding.flags = S_FoldCase;
 
   /* Null means the encoding is unknown. */



reply via email to

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