X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FCGI%2FPkgreport.pm;h=77b55165ae669916679d04c0e7bac69854383ff7;hb=ff74063bdaf0d398417c71e1fe8f58c916f0fb00;hp=da937e5516f0b11d0c5e30892aaccf578afa2222;hpb=038f696edadcbcf8b26f54f4b919702c59e1b1d6;p=debbugs.git diff --git a/Debbugs/CGI/Pkgreport.pm b/Debbugs/CGI/Pkgreport.pm index da937e5..77b5516 100644 --- a/Debbugs/CGI/Pkgreport.pm +++ b/Debbugs/CGI/Pkgreport.pm @@ -469,21 +469,15 @@ sub get_bug_order_index { for my $el (@${order}) { $pos++; - my $match = 0; + my $match = 1; my $first_field = 1; # true if no previous fields have been # checked - while ($el =~ /(?^|\+|,)(?[^=]+)=(?[^=,\+])/g) { + while ($el =~ /(?^|\+|,)(?[^=]+)=(?[^=,\+]+)/g) { my ($j,$f,$v) = @+{qw(joiner field value)}; - if (not defined $j) { - $j = '+'; - } - if ($j eq '+' and $first_field) { - $match = 1; - } my $isokay = 0; $isokay = 1 if (defined $status->{$f} and $v eq $status->{$f}); $isokay = 1 if ($f eq "tag" && defined $tags{$v}); - if ($j eq ',') { + if (defined $j and $j eq ',') { $match ||= $isokay; } else { $match &&= $isokay; @@ -493,8 +487,8 @@ sub get_bug_order_index { # if there is a match, or if there were no fields to check, # this usertag matched. if ($match || $first_field) { - return $pos; - last; + return $pos; + last; } } return $pos + 1;