X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FText%2FWrap.pm;h=2327666038131d401cc2b41ed274e0819713cf3d;hb=718842b0e14b2d067314bf35e22eac61894424e9;hp=8dd1f6c2512dea7419161c9ca53a28f3c7332575;hpb=7fef744d4001fa86c45f1d45805860ed8598b95a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Text/Wrap.pm b/lib/Text/Wrap.pm index 8dd1f6c..2327666 100644 --- a/lib/Text/Wrap.pm +++ b/lib/Text/Wrap.pm @@ -34,6 +34,7 @@ sub wrap my $t = expand(join("", (map { /\s+\z/ ? ( $_ ) : ($_, ' ') } @t), $tail)); my $lead = $ip; my $ll = $columns - length(expand($ip)) - 1; + $ll = 0 if $ll < 0; my $nll = $columns - length(expand($xp)) - 1; my $nl = ""; my $remainder = ""; @@ -144,7 +145,7 @@ B C is a very simple paragraph formatter. It formats a single paragraph at a time by breaking lines at word boundries. Indentation is controlled for the first line (C<$initial_tab>) and -all subsquent lines (C<$subsequent_tab>) independently. Please note: +all subsequent lines (C<$subsequent_tab>) independently. Please note: C<$initial_tab> and C<$subsequent_tab> are the literal strings that will be used: it is unlikley you would want to pass in a number.