From: cjwatson <> Date: Fri, 18 Oct 2002 08:06:41 +0000 (-0800) Subject: [project @ 2002-10-18 01:06:41 by cjwatson] X-Git-Tag: release/2.6.0~1026 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=fcb007239d6e7d57ce11d3f7386c523cea040287;p=debbugs.git [project @ 2002-10-18 01:06:41 by cjwatson] Escape 'From ' lines in message bodies for mbox downloads (#165160). --- diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index db276a3d..18cf859b 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -304,14 +304,15 @@ if ( $mbox ) { my $tmp = $lines[ 0 ]; $lines[ 0 ] = $lines[ 1 ]; $lines[ 1 ] = $tmp; - $_ = join( "\n", @lines ) . "\n"; } if ( !( $lines[ 0 ] =~ m/^From / ) ) { $ENV{ PATH } = "/bin:/usr/bin:/usr/local/bin"; my $date = `date "+%a %b %d %T %Y"`; chomp $date; - $_ = "From unknown $date\n" . $_; + unshift @lines, "From unknown $date"; } + map { s/^(>*From )/>$1/ } @lines[ 1 .. $#lines ]; + $_ = join( "\n", @lines ) . "\n"; } print join("", @mails ); exit 0;