]> git.donarmstrong.com Git - debbugs.git/blobdiff - cgi/bugreport.cgi
move CGI parameter definitions earlier
[debbugs.git] / cgi / bugreport.cgi
index bf1db2d3ce3fa976945fdcbb6e9e4cdbf19c44e6..fabe9bc85dcc84146f3befbccebb4129c68bf789 100755 (executable)
@@ -73,6 +73,17 @@ my $mbox = $param{'mbox'} eq 'yes';
 my $mime = $param{'mime'} eq 'yes';
 my $avatars = $param{avatars} eq 'yes';
 
+my $trim_headers = ($param{trim} || ((defined $msg and $msg)?'no':'yes')) eq 'yes';
+
+my $mbox_status_message = $param{mboxstat} eq 'yes';
+my $mbox_maint = $param{mboxmaint} eq 'yes';
+$mbox = 1 if $mbox_status_message or $mbox_maint;
+
+# Not used by this script directly, but fetch these so that pkgurl() and
+# friends can propagate them correctly.
+my $archive = $param{'archive'} eq 'yes';
+my $repeatmerged = $param{'repeatmerged'} eq 'yes';
+
 my %bugusertags;
 my %ut;
 my %seen_users;
@@ -124,20 +135,6 @@ if (defined $param{usertag}) {
 }
 
 
-my $trim_headers = ($param{trim} || ((defined $msg and $msg)?'no':'yes')) eq 'yes';
-
-my $mbox_status_message = $param{mboxstat} eq 'yes';
-my $mbox_maint = $param{mboxmaint} eq 'yes';
-$mbox = 1 if $mbox_status_message or $mbox_maint;
-
-
-# Not used by this script directly, but fetch these so that pkgurl() and
-# friends can propagate them correctly.
-my $archive = $param{'archive'} eq 'yes';
-my $repeatmerged = $param{'repeatmerged'} eq 'yes';
-
-
-
 my $buglogfh;
 if ($buglog =~ m/\.gz$/) {
     my $oldpath = $ENV{'PATH'};
@@ -235,6 +232,8 @@ END
       if ($record->{inner_file}) {
           push @lines, $record->{fh}->getline;
           push @lines, $record->{fh}->getline;
+          chomp $lines[0];
+          chomp $lines[1];
       } else {
           @lines = split( "\n", $record->{text}, -1 );
       }
@@ -243,11 +242,12 @@ END
          }
          if ( !( $lines[ 0 ] =~ m/^From / ) ) {
               unshift @lines, "From unknown $date";
-         }
+       }
+      print $lines[0]."\n";
          print map { s/^(>*From )/>$1/; $_."\n" } @lines[ 1 .. $#lines ];
       if ($record->{inner_file}) {
           my $fh = $record->{fh};
-          print <$fh>;
+          print $_ while (<$fh>);
       }
      }
      exit 0;