texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * info/indices (index_offset, info_index_search)


From: Gavin D. Smith
Subject: branch master updated: * info/indices (index_offset, info_index_search) (info_next_index_match, create_virtual_index): Initialize index_offset to -1 rather than 0 to avoid missing the first index entry.
Date: Wed, 28 Sep 2022 16:06:39 -0400

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

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 79c29a9b2e * info/indices (index_offset, info_index_search) 
(info_next_index_match, create_virtual_index): Initialize index_offset to -1 
rather than 0 to avoid missing the first index entry.
79c29a9b2e is described below

commit 79c29a9b2e0a5d3db99b0d3fc17e173029dfcf39
Author: Charles Reilly <git.2022@charlesreilly.com>
AuthorDate: Wed Sep 28 21:05:24 2022 +0100

    * info/indices (index_offset, info_index_search)
    (info_next_index_match, create_virtual_index): Initialize
    index_offset to -1 rather than 0 to avoid missing the first
    index entry.
---
 ChangeLog      |  7 +++++++
 info/indices.c | 10 +++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fe5c3c07cf..3c31f2f669 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-09-28   Charles Reilly  <git.2022@charlesreilly.com>  (tiny change)
+
+       * info/indices (index_offset, info_index_search)
+       (info_next_index_match, create_virtual_index): Initialize
+       index_offset to -1 rather than 0 to avoid missing the first
+       index entry.
+
 2022-09-28  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Config.pm: initialize hashes and determine valid keys by
diff --git a/info/indices.c b/info/indices.c
index 5dfcf3091c..349775b1d2 100644
--- a/info/indices.c
+++ b/info/indices.c
@@ -33,7 +33,7 @@ int show_index_match = 1;
 static REFERENCE **index_index = NULL;
 
 /* The offset of the most recently selected index element. */
-static int index_offset = 0;
+static int index_offset = -1;
 
 /* Whether we are doing initial index search. */
 static int index_initial = 0;
@@ -264,7 +264,7 @@ DECLARE_INFO_COMMAND (info_index_search,
 
   /* If the search failed, return the index offset to where it belongs. */
   if (index_offset == old_offset)
-    index_offset = 0;
+    index_offset = -1;
 }
 
 /* Return true if ENT->label matches "S( <[0-9]+>)?", where S stands
@@ -472,11 +472,11 @@ DECLARE_INFO_COMMAND (info_next_index_match,
   /* If that failed, print an error. */
   if (!result)
     {
-      info_error (index_offset > 0 ?
+      info_error (index_offset >= 0 ?
                   _("No more index entries containing '%s'") :
                   _("No index entries containing '%s'"),
                   index_search);
-      index_offset = 0;
+      index_offset = -1;
       return;
     }
 
@@ -825,7 +825,7 @@ create_virtual_index (FILE_BUFFER *file_buffer, char 
*index_search)
 
   cnt = 0;
 
-  index_offset = 0;
+  index_offset = -1;
   index_initial = 0;
   index_partial = 0;
   while (1)



reply via email to

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