Fix chdir() when rootdir it's an empty string.
--HG-- extra : convert_revision : bb7847fc538401d8c585bcb75114956f879077d3
This commit is contained in:
parent
4bf5c5f750
commit
161f97ce97
|
@ -219,6 +219,9 @@ xbps_remove_binary_pkg(const char *pkgname, bool update)
|
||||||
|
|
||||||
assert(pkgname != NULL);
|
assert(pkgname != NULL);
|
||||||
|
|
||||||
|
if (strcmp(rootdir, "") == 0)
|
||||||
|
rootdir = "/";
|
||||||
|
|
||||||
if (rootdir) {
|
if (rootdir) {
|
||||||
if (chdir(rootdir) == -1)
|
if (chdir(rootdir) == -1)
|
||||||
return errno;
|
return errno;
|
||||||
|
|
|
@ -140,6 +140,9 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg)
|
||||||
rootdir = xbps_get_rootdir();
|
rootdir = xbps_get_rootdir();
|
||||||
flags = xbps_get_flags();
|
flags = xbps_get_flags();
|
||||||
|
|
||||||
|
if (strcmp(rootdir, "") == 0)
|
||||||
|
rootdir = "/";
|
||||||
|
|
||||||
if (rootdir) {
|
if (rootdir) {
|
||||||
if (chdir(rootdir) == -1)
|
if (chdir(rootdir) == -1)
|
||||||
return errno;
|
return errno;
|
||||||
|
|
Loading…
Reference in New Issue