[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Common.pm (_print_current): warn ins
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Common.pm (_print_current): warn instead of dying if 'contents' is not an ARRAY. |
Date: |
Thu, 19 Aug 2021 17:19:00 -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 e3a2b9d * tp/Texinfo/Common.pm (_print_current): warn instead of
dying if 'contents' is not an ARRAY.
e3a2b9d is described below
commit e3a2b9d3ac96ec4aefb668158da5e1f39d141439
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Aug 19 23:17:56 2021 +0200
* tp/Texinfo/Common.pm (_print_current): warn instead
of dying if 'contents' is not an ARRAY.
---
tp/Texinfo/Common.pm | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index c0fdb63..1bf93a5 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -2409,8 +2409,15 @@ sub _print_current($)
my $args = '';
my $contents = '';
$args = "args(".scalar(@{$current->{'args'}}).')' if $current->{'args'};
- $contents = "contents(".scalar(@{$current->{'contents'}}).')'
- if $current->{'contents'};
+ if ($current->{'contents'}) {
+ if (ref($current->{'contents'}) ne 'ARRAY') {
+ # this is most probably a bug
+ $contents = "BUG: NOT array contents ".ref($current->{'contents'});
+ }
+ else {
+ $contents = "contents(".scalar(@{$current->{'contents'}}).')';
+ }
+ }
if ("$cmd$type" ne '') {
return "$cmd$type : $text $args $contents\n$parent_string";
} else {
@@ -2737,7 +2744,7 @@ sub complete_indices {
$self->{'documentlanguage'} = $save_lang;
}
-# Called from Texinfo::Parser and Texinfo::XS::parsetexi::Parsetexi.
+# Called from Texinfo::ParserNonXS and Texinfo::XS::parsetexi::Parsetexi.
sub labels_information
{
my $self = shift;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Common.pm (_print_current): warn instead of dying if 'contents' is not an ARRAY.,
Patrice Dumas <=