Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
if pkgdb_it_next return EPKG_FATAL directly continue in the loop without trying to get informations out of the struct pkg which will be NULL in that case.
Baptiste Daroussin committed 13 years ago
commit 379db0cffbfbb41e8f7dd17bf4998fcbfa0da854
parent d1cbb77
1 file changed +5 -5
modified pkg/clean.c
@@ -101,13 +101,13 @@ exec_clean(int argc, char **argv)
			continue;
		}

-
		ret = pkgdb_it_next(it, &p, PKG_LOAD_BASIC);
-
		to_delete = false;
-
		pkg_get(p, PKG_REPOPATH, &pkgrepopath);
-
		if (ret == EPKG_FATAL) {
+
		if ((ret = pkgdb_it_next(it, &p, PKG_LOAD_BASIC)) == EPKG_FATAL) {
			warnx("skipping %s", ent->fts_path);
			continue;
-
		} else if (ret == EPKG_END) {
+
		}
+
		to_delete = false;
+
		pkg_get(p, PKG_REPOPATH, &pkgrepopath);
+
		if (ret == EPKG_END) {
			to_delete = true;
			printf("%s does not exist anymore, deleting it\n", repopath);
		} else if (strcmp(repopath, pkgrepopath)) {