Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Do not fail the assert in pkgdb_rquery.
Vsevolod Stakhov committed 12 years ago
commit d505d0703dde71c979ea6ba4407335501507e783
parent 4ab18ed
1 file changed +7 -0
modified libpkg/pkgdb.c
@@ -3543,6 +3543,13 @@ pkgdb_rquery(struct pkgdb *db, const char *pattern, match_t match,
	assert(db != NULL);
	assert(match == MATCH_ALL || (pattern != NULL && pattern[0] != '\0'));

+
	/*
+
	 * If we have no remote repos loaded, we just return nothing instead of failing
+
	 * an assert deep inside pkgdb_get_reponame
+
	 */
+
	if (db->type != PKGDB_REMOTE)
+
		return (NULL);
+

	reponame = pkgdb_get_reponame(db, repo);

	sql = sbuf_new_auto();