texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Common.pm (locate_file_in_dirs), tp


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Common.pm (locate_file_in_dirs), tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser), tp/ext/epub3.pm (epub_convert_image_command), tp/init/html32.pm (html32_convert_item_command): check that hashes exist before accessing them to avoid spurious autovivification.
Date: Thu, 14 Nov 2024 04:50:16 -0500

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 3d2ba738be * tp/Texinfo/Common.pm (locate_file_in_dirs), 
tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser), tp/ext/epub3.pm 
(epub_convert_image_command), tp/init/html32.pm (html32_convert_item_command): 
check that hashes exist before accessing them to avoid spurious 
autovivification.
3d2ba738be is described below

commit 3d2ba738be2db5e86465498aa9d3660feda34512
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Nov 14 10:50:10 2024 +0100

    * tp/Texinfo/Common.pm (locate_file_in_dirs),
    tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser), tp/ext/epub3.pm
    (epub_convert_image_command), tp/init/html32.pm
    (html32_convert_item_command): check that hashes exist before
    accessing them to avoid spurious autovivification.
---
 ChangeLog                            | 8 ++++++++
 tp/Texinfo/Common.pm                 | 2 +-
 tp/Texinfo/XS/parsetexi/Parsetexi.pm | 2 +-
 tp/ext/epub3.pm                      | 3 ++-
 tp/init/html32.pm                    | 2 +-
 5 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 596b1a9898..4dc5252589 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-11-14  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm (locate_file_in_dirs),
+       tp/Texinfo/XS/parsetexi/Parsetexi.pm (parser), tp/ext/epub3.pm
+       (epub_convert_image_command), tp/init/html32.pm
+       (html32_convert_item_command): check that hashes exist before
+       accessing them to avoid spurious autovivification.
+
 2024-11-14  Patrice Dumas  <pertusus@free.fr>
 
        * tp/t/test_sort.t: call
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 6f2881fd1f..dc4e062cc9 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -1020,7 +1020,7 @@ sub locate_file_in_dirs($$$;$)
         next unless (-d $dir);
         my $possible_file = File::Spec->catfile($dir, $input_file_path);
         if (-e $possible_file and -r $possible_file) {
-          if ($deprecated_dirs->{$dir}) {
+          if ($deprecated_dirs and $deprecated_dirs->{$dir}) {
             $deprecated_dirs_used = [] if (!defined($deprecated_dirs_used));
             push @$deprecated_dirs_used, $dir;
           }
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.pm 
b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
index dee6b14ed2..e908d45411 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.pm
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.pm
@@ -57,7 +57,7 @@ sub parser (;$)
   # parser configuration, as the configuration isn't already reset and the new
   # configuration is set afterwards.
   my $debug = 0;
-  $debug = $conf->{'DEBUG'} if ($conf->{'DEBUG'});
+  $debug = $conf->{'DEBUG'} if ($conf and $conf->{'DEBUG'});
 
   # The reset_parser call resets the conf to the same values as found in
   # Texinfo::Common parser_document_parsing_options.
diff --git a/tp/ext/epub3.pm b/tp/ext/epub3.pm
index b3c9b86bc2..07da9bcfe0 100644
--- a/tp/ext/epub3.pm
+++ b/tp/ext/epub3.pm
@@ -261,7 +261,8 @@ sub epub_convert_image_command($$$$)
   my $command = shift;
   my $args = shift;
 
-  if (defined($args->[0]->{'filenametext'})
+  if ($args and defined($args->[0])
+      and defined($args->[0]->{'filenametext'})
       and $args->[0]->{'filenametext'} ne '') {
     my $image_basefile = $args->[0]->{'filenametext'};
     my $basefile_string = '';
diff --git a/tp/init/html32.pm b/tp/init/html32.pm
index cdc368271a..8575a2cced 100644
--- a/tp/init/html32.pm
+++ b/tp/init/html32.pm
@@ -309,7 +309,7 @@ sub html32_convert_item_command($$$$$)
       and $command->{'parent'}->{'cmdname'} eq 'itemize') {
     my $prepend ;
     my $itemize = $command->{'parent'};
-    if ($itemize->{'extra'}->{'command_as_argument'}
+    if ($itemize->{'extra'} and $itemize->{'extra'}->{'command_as_argument'}
        and $itemize->{'extra'}->{'command_as_argument'}->{'cmdname'} eq 
'bullet') {
       $prepend = '';
     } else {



reply via email to

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