summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas François <nicolas.francois@centraliens.net>2019-09-27 14:53:06 +0200
committergregor herrmann <gregoa@debian.org>2019-09-27 14:53:06 +0200
commita12533c2608f3d6e409f26cea6afb4e23455ca05 (patch)
treee803ccbb441c2eb9516df5265ae1562316682a11
parent015d4ba152b5cb5a40014ec3edfa63a2ea53a04f (diff)
The infinite loop occurs in Text::WrapI18N when po4a tries to report an error in the PO files.HEADarchive/debian/0.06-9master
Origin: vendor Bug-Debian: https://bugs.debian.org/470250 Forwarded: unknown Reviewed-by: gregor herrmann <gregoa@debian.org> Last-Update: 2019-03-21 I could reproduce the problem in WrapI18N::wrap() and I propose the attached patch to WrapI18N::wrap(). (A word should be placed on the next line if it fits on this line, but the leading header must be taken into account, thus $columns -> $columns - length $header) Gbp-Pq: Name 01-470250-WrapI18N.pm.patch
-rw-r--r--WrapI18N.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/WrapI18N.pm b/WrapI18N.pm
index 6e5350b..4d9d73c 100644
--- a/WrapI18N.pm
+++ b/WrapI18N.pm
@@ -88,7 +88,7 @@ sub wrap {
$len = 0;
$text = $top2 . $text;
$word = ''; $wlen = 0;
- } elsif ($wlen + $w <= $columns) {
+ } elsif ($wlen + $w <= $columns - length ($top2)) {
# the current word is sent to next line
$out .= $separator;
$len = 0;