From ed18d4ad1743445dc1c49d65b5a64a0c73510edd Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 24 Aug 1999 08:52:17 +0000 Subject: no_comment --- perl-install/common.pm | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'perl-install/common.pm') diff --git a/perl-install/common.pm b/perl-install/common.pm index ca6d9840d..78533befc 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -173,18 +173,23 @@ sub untranslate($@) { } sub warp_text($;$) { - my ($text, $width) = shift; + my ($text, $width) = @_; $width ||= 80; - - my ($t, @l); foreach (split /\s+/, $text) { - if (length "$t $_" > $width) { - push @l, $t; - $t = $_; - } else { - $t = "$t $_"; + + my @l; + foreach (split "\n", $text) { + my $t; + foreach (split /\s+/, $_) { + if (length "$t $_" > $width) { + push @l, $t; + $t = $_; + } else { + $t = "$t $_"; + } } + push @l, $t; } - @l, $t; + @l; } sub getVarsFromSh($) { -- cgit v1.2.1