]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Status.pm
Only search for the first Format-Version: and use it
[debbugs.git] / Debbugs / Status.pm
index 9b59045aa848164b8966b0e115ecc91bf1465434..2c6ce209e9c07dccbcde3335e0da25803c5dc544 100644 (file)
@@ -227,15 +227,19 @@ sub read_bug{
 
     my %data;
     my @lines;
-    my $version = 2;
+    my $version;
     local $_;
 
     while (<$status_fh>) {
         chomp;
         push @lines, $_;
-        $version = $1 if /^Format-Version: ([0-9]+)/i;
+       if (not defined $version and
+           /^Format-Version: ([0-9]+)/i
+          ) {
+           $version = $1;
+       }
     }
-
+    $version = 2 if not defined $version;
     # Version 3 is the latest format version currently supported.
     if ($version > 3) {
         warn "Unsupported status version '$version'";