texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/ParserNonXS.pm (_enter_index_entry):


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ParserNonXS.pm (_enter_index_entry): initialize 'index_entries' to an empty array for the index even if the entry being processed has seeentry or seealso and won't be pushed on the 'index_entries' array.
Date: Thu, 29 Sep 2022 03:20:19 -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 1cb8c3c09a * tp/Texinfo/ParserNonXS.pm (_enter_index_entry): 
initialize 'index_entries' to an empty array for the index even if the entry 
being processed has seeentry or seealso and won't be pushed on the 
'index_entries' array.
1cb8c3c09a is described below

commit 1cb8c3c09a0b4c1fe2d2db8c81c6dd11bb05dc46
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Sep 29 09:20:07 2022 +0200

    * tp/Texinfo/ParserNonXS.pm (_enter_index_entry): initialize 'index_entries'
    to an empty array for the index even if the entry being processed has
    seeentry or seealso and won't be pushed on the 'index_entries' array.
---
 ChangeLog                 |  6 ++++++
 tp/Texinfo/ParserNonXS.pm | 12 +++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index afa4da0a25..16bb277b64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-29  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ParserNonXS.pm (_enter_index_entry): initialize 
'index_entries'
+       to an empty array for the index even if the entry being processed has
+       seeentry or seealso and won't be pushed on the 'index_entries' array.
+
 2022-09-28  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Transformations.pm (_protect_hashchar_at_line_beginning)
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 9dc126ed73..45a50ecf44 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -2723,9 +2723,15 @@ sub _enter_index_entry($$$$$$$)
   my $index_name = $self->{'command_index'}->{$command_container};
   my $index = $self->{'index_names'}->{$index_name};
 
-  my $number = (defined($index->{'index_entries'})
-                ? (scalar(@{$index->{'index_entries'}}) + 1)
-                  : 1);
+  # if the entry has seeentry or seealso it won't be pushed in
+  # $index->{'index_entries'}, so it may remain empty.
+  if (!defined($index->{'index_entries'})) {
+    $index->{'index_entries'} = [];
+  }
+
+  # not accounting for seeentry/seealso entries
+  my $number = scalar(@{$index->{'index_entries'}}) + 1;
+
   # FIXME index_type_command does not seems to be used anywhere.
   # It appears in test results tree, so maybe it is worth keeping
   # it to be able to understand changes.



reply via email to

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