]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/Bugs.pm
fix forward links in pkgreport, add support for indexing on status
[debbugs.git] / Debbugs / Bugs.pm
index 010d671618d20c05e9883d47463c0d67664626de..62cd03f8c03e483acc01ef4f786aca4bfec0e81b 100644 (file)
@@ -290,7 +290,7 @@ sub newest_bug {
      my $next_number = <$nn_fh>;
      close $nn_fh;
      chomp $next_number;
-     return $next_number+0;
+     return $next_number-1;
 }
 
 =head2 bug_filter
@@ -433,13 +433,20 @@ sub get_bugs_by_idx{
               or die "Unable to open $index: $!";
          my %bug_matching = ();
          for my $search (make_list($param{$key})) {
-              next unless defined $idx{$search};
-              for my $bug (keys %{$idx{$search}}) {
+              for my $bug (keys %{$idx{$search}||{}}) {
                    next if $bug_matching{$bug};
                    # increment the number of searches that this bug matched
                    $bugs{$bug}++;
                    $bug_matching{$bug}=1;
               }
+              if ($search ne lc($search)) {
+                   for my $bug (keys %{$idx{lc($search)}||{}}) {
+                        next if $bug_matching{$bug};
+                        # increment the number of searches that this bug matched
+                        $bugs{$bug}++;
+                        $bug_matching{$bug}=1;
+                   }
+              }
          }
          if ($key eq 'tag' and exists $param{usertags}) {
               for my $bug (make_list(grep {defined $_ } @{$param{usertags}}{make_list($param{tag})})) {