]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2002-10-07 00:15:49 by cjwatson]
authorcjwatson <>
Mon, 7 Oct 2002 07:15:49 +0000 (23:15 -0800)
committercjwatson <>
Mon, 7 Oct 2002 07:15:49 +0000 (23:15 -0800)
Don't assume att=0 if msg= is set - we might just be trying to view a
boring message, which could potentially have attachments.

cgi/bugreport.cgi

index eeeecef4c054d5a349fc92c64e85857d6dd4a067..77da0e5babcfc90add31fe8ff5612957e5c81420 100755 (executable)
@@ -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 = <L>) {
                                                                push @attachments, $_;
                                                                my $file = $_->head->recommended_filename;
                                                                $downloadHtml .= "View Attachment: <a href=\"".dlurl($ref,"msg=$xmessage","att=$#attachments","filename=$file")."\">$file</a>\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"));