Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Check the real directory path against used directories, and fix the counter comparison
Baptiste Daroussin committed 11 years ago
commit 0a109a5961deb833b287202229f8d9ddb5285009
parent 23ace6f
1 file changed +2 -2
modified libpkg/pkg_delete.c
@@ -163,11 +163,11 @@ rmdir_p(struct pkgdb *db, struct pkg *pkg, char *dir, const char *prefix_r)
	char fullpath[MAXPATHLEN];

	snprintf(fullpath, sizeof(fullpath), "/%s", dir);
-
	if (pkgdb_is_dir_used(db, dir, &cnt) != EPKG_OK)
+
	if (pkgdb_is_dir_used(db, fullpath, &cnt) != EPKG_OK)
		return;

	pkg_debug(1, "Number of packages owning %d\n", cnt);
-
	if (cnt > 1)
+
	if (cnt > 0)
		return;

	if (strcmp(prefix_r, dir) == 0)