Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Small simplification of the empty pattern case
Stefan Eßer committed 4 years ago
commit e9297fec1869dcfdc950ffed7cf75f32b4415362
parent 5c357fb
1 file changed +2 -2
modified libpkg/repo/binary/query.c
@@ -120,8 +120,8 @@ pkg_repo_binary_query(struct pkg_repo *repo, const char *cond, const char *patte
	if (cond == NULL)
		xasprintf(&sql, basesql, repo->name, comp, "", "", "");
	else
-
		xasprintf(&sql, basesql, repo->name, comp ? comp : "",
-
		    comp[0] ? "AND (" : "WHERE (", cond + 7, ")");
+
		xasprintf(&sql, basesql, repo->name, comp,
+
		    comp[0] != '\0' ? "AND (" : "WHERE (", cond + 7, ")");

	pkg_debug(4, "Pkgdb: running '%s' query for %s", sql,
	     pattern == NULL ? "all": pattern);