aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'misc/install-xattr/install-xattr.c')
-rw-r--r--misc/install-xattr/install-xattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/install-xattr/install-xattr.c b/misc/install-xattr/install-xattr.c
index 2966af4..33b9fe1 100644
--- a/misc/install-xattr/install-xattr.c
+++ b/misc/install-xattr/install-xattr.c
@@ -345,7 +345,7 @@ main(int argc, char* argv[])
char *portage_helper_path = getenv("__PORTAGE_HELPER_PATH");
char *portage_helper_canpath = NULL;
if (portage_helper_path)
- if (chdir(oldpwd) != 0)
+ if (!oldpwd || chdir(oldpwd) != 0)
err(1, "failed to chdir %s", oldpwd);
switch (fork()) {