texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Find first index entry under initial substring se


From: Gavin D. Smith
Subject: branch master updated: Find first index entry under initial substring search
Date: Wed, 09 Mar 2022 12:24:01 -0500

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 730d600e2a Find first index entry under initial substring search
730d600e2a is described below

commit 730d600e2a64a20859f69713dd23fc40ab30d688
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Mar 9 17:23:50 2022 +0000

    Find first index entry under initial substring search
    
    * info/next_index_match): Reset index search by setting index to -1
    index instead of 0.  Otherwise the first index entry is skipped
    when checking for initial substrings.  The very first index entry
    in an Info file would not be found with a non-exact search.
    Report from Sergey Matveev <stargrave@stargrave.org>.
---
 ChangeLog                  | 10 ++++++++++
 info/indices.c             |  4 ++--
 info/t/index-completing.sh |  4 ++--
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 81c3dbc1ca..4d249bca24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-03-09  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       Find first index entry under initial substring search
+
+       * info/next_index_match): Reset index search by setting index to -1
+       index instead of 0.  Otherwise the first index entry is skipped
+       when checking for initial substrings.  The very first index entry
+       in an Info file would not be found with a non-exact search.
+       Report from Sergey Matveev <stargrave@stargrave.org>.
+
 2022-03-06  Patrice Dumas  <pertusus@free.fr>
 
        * tp/init/latex2html.pm (l2h_process, l2h_to_html)
diff --git a/info/indices.c b/info/indices.c
index 6f5ef8a1f1..f798c61290 100644
--- a/info/indices.c
+++ b/info/indices.c
@@ -338,7 +338,7 @@ next_index_match (FILE_BUFFER *fb, char *string, int 
offset, int dir,
 
       if (i < 0 || !index_index[i])
        {
-          offset = 0;
+          offset = -1;
           index_initial = 1;
        }
     }
@@ -355,7 +355,7 @@ next_index_match (FILE_BUFFER *fb, char *string, int 
offset, int dir,
 
       if (i < 0 || !index_index[i])
        {
-          offset = 0;
+          offset = -1;
           index_initial = 0;
           index_partial = 1;
        }
diff --git a/info/t/index-completing.sh b/info/t/index-completing.sh
index c0c579d894..6653eeb6c7 100755
--- a/info/t/index-completing.sh
+++ b/info/t/index-completing.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2014-2019 Free Software Foundation, Inc.
+# Copyright (C) 2014-2022 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@ run_ginfo -f index-search
 printf 'i\t\rDq' >&7
 timeout_test
 
-grep '^Node: Node 2' $ginfo_output
+grep '^Node: Node 1' $ginfo_output
 retval=$?
 
 cleanup



reply via email to

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