Index: echangelog =================================================================== --- echangelog (revision 567) +++ echangelog (working copy) @@ -89,6 +89,28 @@ return undef; } +# Copied from Text::Wrap. +# The only modified thing is: +# $pp =~ s/[\x09|\x0B|\x0C|\x20]+/ /g; +# Which was just s/\s+/ /g; before. +# So even \n/\r has been treated as whitespace. +sub text_fill { + my ($ip, $xp, @raw) = @_; + my @para; + my $pp; + + for $pp (split(/\n\s+/, join("\n",@raw))) { + $pp =~ s/[\x09|\x0B|\x0C|\x20]+/ /g; + my $x = wrap($ip, $xp, $pp); + push(@para, $x); + } + + # if paragraph_indent is the same as line_indent, + # separate paragraphs with blank lines + my $ps = ($ip eq $xp) ? "\n\n" : "\n"; + return join ($ps, @para); +} + GetOptions( 'help' => \$opt_help, 'strict' => \$opt_strict, @@ -499,8 +521,8 @@ # If there are any long lines, then wrap the input at $columns chars # (leaving 2 chars on left, one char on right, after adding indentation below). -$input =~ s/^\s*(.*?)\s*\z/$1/s; # trim whitespace -$input = Text::Wrap::fill(' ', ' ', $input); +# FIXME: Testing wrt bug 264146 +$input = text_fill(' ', ' ', $input); # Prepend the user info to the input # Changes related to bug 213374;