From: cjwatson <> Date: Mon, 7 Oct 2002 07:15:49 +0000 (-0800) Subject: [project @ 2002-10-07 00:15:49 by cjwatson] X-Git-Tag: release/2.6.0~1035 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5a7327a9837e01d2829c2e8b2ba9de76b0ad9a57;p=debbugs.git [project @ 2002-10-07 00:15:49 by cjwatson] Don't assume att=0 if msg= is set - we might just be trying to view a boring message, which could potentially have attachments. --- diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index eeeecef4..77da0e5b 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -25,7 +25,7 @@ my %pkgsrc = %{getpkgsrc()}; my $ref = $param{'bug'} || quit("No bug number"); my $msg = $param{'msg'} || ""; -my $att = $param{'att'} || "0"; +my $att = $param{'att'}; my $boring = ($param{'boring'} || 'no') eq 'yes'; my $reverse = ($param{'reverse'} || 'no') eq 'yes'; my $mbox = ($param{'mbox'} || 'no') eq 'yes'; @@ -186,7 +186,7 @@ while(my $line = ) { push @attachments, $_; my $file = $_->head->recommended_filename; $downloadHtml .= "View Attachment: $file\n"; - if ($msg && $att eq $#attachments) { + if ($msg && defined($att) && $att eq $#attachments) { my $head = $_->head; my $type; chomp($type = $head->mime_attr("content-type"));