about summary refs log tree commit diff
path: root/Src/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/init.c')
-rw-r--r--Src/init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/init.c b/Src/init.c
index dea9aff40..06f177725 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -861,8 +861,10 @@ setupvals(void)
     else if ((ptr = zgetenv("PWD")) && (strlen(ptr) < PATH_MAX) &&
 	     (ptr = metafy(ptr, -1, META_STATIC), ispwd(ptr)))
 	pwd = ztrdup(ptr);
-    else
+    else {
+	pwd = NULL;
 	pwd = metafy(zgetcwd(), -1, META_DUP);
+    }
 
     oldpwd = ztrdup(pwd);  /* initialize `OLDPWD' = `PWD' */