Skip to content

Commit

Permalink
Fixed a bug with util_db_search returning false when it shouldn't
Browse files Browse the repository at this point in the history
Also reduced optimization level from 3 to 2 for stability.
  • Loading branch information
BurntRanch committed May 16, 2024
1 parent 3487087 commit 2cd6677
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ifeq ($(DEBUG), 1)
CXXFLAGS := -ggdb -pedantic -Wall $(CXXFLAGS)
else
BUILDDIR = build/release
CXXFLAGS := -O3 $(CXXFLAGS)
CXXFLAGS := -O2 $(CXXFLAGS)
endif

LDFLAGS := -L./$(BUILDDIR)/fmt -L./$(BUILDDIR)/cpr $(LDFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ string makepkg_list(string_view pkg_name, string path) {
* Why? well, alpm_db_search searches for results that match ALL regex patterns, this one searches for results that match ANY regex pattern.
*/
bool util_db_search(alpm_db_t *db, alpm_list_t *needles, alpm_list_t **ret) {
if (!db || !needles || ret != nullptr)
if (!db || !needles || *ret != nullptr)
return false;

for (; needles; needles = needles->next) {
Expand Down

0 comments on commit 2cd6677

Please sign in to comment.