From b57d06ea22b2a81414e5237104df1f95c6318f0a Mon Sep 17 00:00:00 2001 From: Alad Wenter Date: Fri, 5 Jan 2024 00:40:42 +0100 Subject: [PATCH] repo-parse: only increase counter on matches Issue #1126 --- lib/aur-repo-parse | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/aur-repo-parse b/lib/aur-repo-parse index ea361ac9..71f5009d 100755 --- a/lib/aur-repo-parse +++ b/lib/aur-repo-parse @@ -64,11 +64,10 @@ sub parse_db { # Evaluate condition on previous entry and run handler if ($count > 0) { if (entry_search($search_expr, $entry->{$search_label})) { - $handler->($entry, $count, 0, @varargs); + $handler->($entry, $count++, 0, @varargs); } - ++$count; } else { - ++$count; + $count++; } # New entry in the database (hashref) %{$entry} = (); @@ -125,7 +124,7 @@ sub repo_json { my $json_text = write_json($pkg); print $json_text; } - print "]\n" if $last == 1; + print "]\n" if $last == 1; } sub repo_jsonl { -- 2.11.4.GIT