texinfo-commits
[Top][All Lists]
Advanced

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

[7540] _parse_texi call labels_information


From: gavinsmith0123
Subject: [7540] _parse_texi call labels_information
Date: Fri, 9 Dec 2016 22:26:50 +0000 (UTC)

Revision: 7540
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7540
Author:   gavin
Date:     2016-12-09 22:26:49 +0000 (Fri, 09 Dec 2016)
Log Message:
-----------
_parse_texi call labels_information

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Parser.pm

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-12-09 21:39:00 UTC (rev 7539)
+++ trunk/ChangeLog     2016-12-09 22:26:49 UTC (rev 7540)
@@ -2,6 +2,10 @@
 
        * tp/Texinfo/Parser.pm (_parse_texi): Call 'labels_information' 
        to initialize some data for the first time.
+       (labels_information): Use presence of $self->{'targets'} to 
+       decide whether 'labels' has been initialized, because it is 
+       possible that 'labels' could be initialized to an empty hash, 
+       which would still test as false.
 
 2016-12-08  Gavin Smith  <address@hidden>
 

Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm  2016-12-09 21:39:00 UTC (rev 7539)
+++ trunk/tp/Texinfo/Parser.pm  2016-12-09 22:26:49 UTC (rev 7540)
@@ -992,8 +992,7 @@
 sub labels_information($)
 {
   my $self = shift;
-  if (!%{$self->{'labels'}}
-       and defined $self->{'targets'}) {
+  if (defined $self->{'targets'}) {
     my %labels = ();
     for my $target (@{$self->{'targets'}}) {
       if ($target->{'cmdname'} eq 'node') {
@@ -1051,6 +1050,7 @@
       }
     }
     $self->{'labels'} = \%labels;
+    delete $self->{'targets'};
   }
   return $self->{'labels'};
 }




reply via email to

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