xbps_remove_pkg: another missing rootdir check.

--HG--
extra : convert_revision : 1c2699c4d11073d49a01936c79a95968b0fb4b93
This commit is contained in:
Juan RP 2009-08-10 10:29:17 +02:00
parent 90b9325fbd
commit 1986dc93f3

View File

@ -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;