about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2003-04-23 18:04:05 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2003-04-23 18:04:05 +0000
commit5b5c0175d5d4bb45c63f7fcf62c2f476fde1ee64 (patch)
treeba5c3869c09d1a1afa876405342925f8a0952688
parent29a3496ebb91cc418db4b5ba66837c59c8170df5 (diff)
downloadzsh-5b5c0175d5d4bb45c63f7fcf62c2f476fde1ee64.tar.gz
zsh-5b5c0175d5d4bb45c63f7fcf62c2f476fde1ee64.tar.xz
zsh-5b5c0175d5d4bb45c63f7fcf62c2f476fde1ee64.zip
IKEGAMI Tsutomu: sf bug 722366: metafy pwd when read from $PWD
-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);