From 1986dc93f36b8eae7d242c149f0f50f3a6dc9eee Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 10 Aug 2009 10:29:17 +0200 Subject: [PATCH] xbps_remove_pkg: another missing rootdir check. --HG-- extra : convert_revision : 1c2699c4d11073d49a01936c79a95968b0fb4b93 --- lib/remove.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/remove.c b/lib/remove.c index 402944d7a93..81a1b611456 100644 --- a/lib/remove.c +++ b/lib/remove.c @@ -292,6 +292,9 @@ xbps_remove_pkg(const char *pkgname, const char *version, bool update) if (xbps_check_is_installed_pkgname(pkgname) == false) return ENOENT; + if (strcmp(rootdir, "") == 0) + rootdir = "/"; + if (chdir(rootdir) == -1) return errno;