about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/init.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 8fcebc5d8..7d4b68aef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-23  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
+
+	* IKEGAMI Tsutomu: SourceForge bug 722366: initialisation of pwd
+	from PWD in environment didn't metafy.
+
 2003-04-23  Oliver Kiddle  <opk@zsh.org>
 
 	* 18462: Completion/Unix/Command/_sh: complete files in addition
diff --git a/Src/init.c b/Src/init.c
index 2118a5f5f..e3a6bda3a 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -780,7 +780,8 @@ setupvals(void)
      * initialize `PWD' from `HOME'      */
     if (ispwd(home))
 	pwd = ztrdup(home);
-    else if ((ptr = zgetenv("PWD")) && ispwd(ptr))
+    else if ((ptr = zgetenv("PWD")) && (strlen(ptr) < PATH_MAX) &&
+	     (ptr = metafy(ptr, -1, META_STATIC), ispwd(ptr)))
 	pwd = ztrdup(ptr);
     else
 	pwd = metafy(zgetcwd(), -1, META_DUP);