summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/perlbug.t3
-rw-r--r--utils/perlbug.PL13
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/perlbug.t b/lib/perlbug.t
index ede26af6d6..ed32c044f3 100644
--- a/lib/perlbug.t
+++ b/lib/perlbug.t
@@ -151,8 +151,5 @@ for (split(/\n/, $contents)) {
$maxlen1 = $len if $len > $maxlen1 and !/$B/;
$maxlen2 = $len if $len > $maxlen2 and /$B/;
}
-TODO: {
-local $::TODO = 'long body lines not wrapped yet';
ok($maxlen1 < 1000, "[perl #128020] long body lines are wrapped: maxlen $maxlen1");
-}
ok($maxlen2 > 1000, "long attachment lines are not wrapped: maxlen $maxlen2");
diff --git a/utils/perlbug.PL b/utils/perlbug.PL
index 95e34fe051..6290ca76e8 100644
--- a/utils/perlbug.PL
+++ b/utils/perlbug.PL
@@ -76,6 +76,8 @@ BEGIN {
$::HaveTemp = ($@ eq "");
eval { require Module::CoreList; };
$::HaveCoreList = ($@ eq "");
+ eval { require Text::Wrap; };
+ $::HaveWrap = ($@ eq "");
};
my $Version = "1.40";
@@ -1084,7 +1086,16 @@ sub _read_report {
my $content;
open( REP, "<:raw", $fname ) or die "Couldn't open file '$fname': $!\n";
binmode(REP, ':raw :crlf') if $Is_MSWin32;
- while (<REP>) { $content .= $_; }
+ # wrap long lines to make sure the report gets delivered
+ local $Text::Wrap::columns = 900;
+ local $Text::Wrap::huge = 'overflow';
+ while (<REP>) {
+ if ($::HaveWrap && /\S/) { # wrap() would remove empty lines
+ $content .= Text::Wrap::wrap(undef, undef, $_);
+ } else {
+ $content .= $_;
+ }
+ }
close(REP) or die "Error closing report file '$fname': $!";
return $content;
}