[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[6332] avoid negative repeat counts for perl 5.22.0
From: |
karl |
Subject: |
[6332] avoid negative repeat counts for perl 5.22.0 |
Date: |
Thu, 11 Jun 2015 23:35:57 +0000 |
Revision: 6332
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6332
Author: karl
Date: 2015-06-11 23:35:57 +0000 (Thu, 11 Jun 2015)
Log Message:
-----------
avoid negative repeat counts for perl 5.22.0
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Texinfo/Convert/Plaintext.pm
trunk/tp/Texinfo/Convert/UnFilled.pm
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2015-06-10 22:59:45 UTC (rev 6331)
+++ trunk/ChangeLog 2015-06-11 23:35:57 UTC (rev 6332)
@@ -1,3 +1,9 @@
+2015-06-11 Karl Berry <address@hidden>
+
+ * tp/Texinfo/Convert/UnFilled.pm (_add_text),
+ * tp/Texinfo/Convert/Plaintext.pm (_contents):
+ avoid negative repeat counts, which cause a warning in perl 5.22.0.
+
2015-06-10 Karl Berry <address@hidden>
* doc/refcard/txicmdcheck (read_refcard): \escape all the {
Modified: trunk/tp/Texinfo/Convert/Plaintext.pm
===================================================================
--- trunk/tp/Texinfo/Convert/Plaintext.pm 2015-06-10 22:59:45 UTC (rev
6331)
+++ trunk/tp/Texinfo/Convert/Plaintext.pm 2015-06-11 23:35:57 UTC (rev
6332)
@@ -1129,7 +1129,9 @@
my $text = $section_title;
chomp ($text);
$text .= "\n";
- $result .= (' ' x (2*($section->{'level'} - ($root_level+1)))) . $text;
+ my $repeat_count = 2 * ($section->{'level'} - ($root_level+1));
+ ($result .= (' ' x $repeat_count)) if $repeat_count > 0;
+ $result .= $text;
$lines_count++;
if ($section->{'section_childs'}
and ($contents or $section->{'level'} < $root_level+1)) {
Modified: trunk/tp/Texinfo/Convert/UnFilled.pm
===================================================================
--- trunk/tp/Texinfo/Convert/UnFilled.pm 2015-06-10 22:59:45 UTC (rev
6331)
+++ trunk/tp/Texinfo/Convert/UnFilled.pm 2015-06-11 23:35:57 UTC (rev
6332)
@@ -90,8 +90,8 @@
my $text = shift;
if ($line->{'line_beginning'}) {
if ($line->{'indent_length'}) {
- $line->{'leading_spaces'} .=
- ' ' x ($line->{'indent_length'} - $line->{'counter'});
+ my $nspaces = $line->{'indent_length'} - $line->{'counter'};
+ ($line->{'leading_spaces'} .= ' ' x $nspaces) if $nspaces > 0;
print STDERR "INDENT.U($line->{'counter'})\n" if ($line->{'DEBUG'});
}
$line->{'line_beginning'} = 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [6332] avoid negative repeat counts for perl 5.22.0,
karl <=