texinfo-commits
[Top][All Lists]
Advanced

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

[7976] check if array elements defined


From: gavinsmith0123
Subject: [7976] check if array elements defined
Date: Sat, 28 Oct 2017 16:46:28 -0400 (EDT)

Revision: 7976
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7976
Author:   gavin
Date:     2017-10-28 16:46:28 -0400 (Sat, 28 Oct 2017)
Log Message:
-----------
check if array elements defined

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Convert/TexinfoXML.pm

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2017-10-26 21:59:36 UTC (rev 7975)
+++ trunk/ChangeLog     2017-10-28 20:46:28 UTC (rev 7976)
@@ -1,3 +1,8 @@
+2017-10-28  Gavin Smith  <address@hidden>
+
+       * tp/Texinfo/Convert/TexinfoXML.pm (_convert): Check if array 
+       elements are defined to avoid creating them accidentally.
+
 2017-10-26  Gavin Smith  <address@hidden>
 
        * tp/Texinfo/Convert/TexinfoXML.pm (_convert): Replace use

Modified: trunk/tp/Texinfo/Convert/TexinfoXML.pm
===================================================================
--- trunk/tp/Texinfo/Convert/TexinfoXML.pm      2017-10-26 21:59:36 UTC (rev 
7975)
+++ trunk/tp/Texinfo/Convert/TexinfoXML.pm      2017-10-28 20:46:28 UTC (rev 
7976)
@@ -1135,6 +1135,7 @@
           $self->{'document_context'}->[-1]->{'raw'} = 1;
         }
         if (scalar (@{$root->{'args'}}) == 2
+              and defined($root->{'args'}->[-1])
               and @{$root->{'args'}->[-1]->{'contents'}}) {
           $result .= $self->_convert({'contents' 
                         => $root->{'args'}->[-1]->{'contents'}});
@@ -1228,7 +1229,8 @@
           if ($root->{'cmdname'} eq 'inforef') {
             $manual_arg_index = 2;
           }
-          if (@{$root->{'args'}->[$manual_arg_index]->{'contents'}}) {
+          if (defined($root->{'args'}->[$manual_arg_index])
+              and @{$root->{'args'}->[$manual_arg_index]->{'contents'}}) {
             $manual = Texinfo::Convert::Text::convert({'contents'
                      => $root->{'args'}->[$manual_arg_index]->{'contents'}},
                       {'code' => 1,




reply via email to

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