about summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:16:27 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-04-15 18:16:27 +0000
commitb4a5b9db8b528f9c9b6a9cbb00db381c95659380 (patch)
tree17bf8f93d47de0af7495ec6d11361aef1ca62f9b /Src/params.c
parentba4f5e80ec9d7e145718e79fed6e57a852c86c12 (diff)
downloadzsh-b4a5b9db8b528f9c9b6a9cbb00db381c95659380.tar.gz
zsh-b4a5b9db8b528f9c9b6a9cbb00db381c95659380.tar.xz
zsh-b4a5b9db8b528f9c9b6a9cbb00db381c95659380.zip
zsh-3.1.5-pws-9 zsh-3.1.5-pws-9
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Src/params.c b/Src/params.c
index 88b5fdf73..77166209f 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -568,8 +568,10 @@ createparam(char *name, int flags)
 
 	if (isset(ALLEXPORT) && !oldpm)
 	    flags |= PM_EXPORTED;
-    } else
+    } else {
 	pm = (Param) alloc(sizeof *pm);
+	pm->nam = nulstring;
+    }
     pm->flags = flags;
 
     if(!(pm->flags & PM_SPECIAL))
@@ -1835,6 +1837,12 @@ arrhashsetfn(Param pm, char **val)
     while (*aptr) {
 	/* The parameter name is ztrdup'd... */
 	v->pm = createparam(*aptr, PM_SCALAR|PM_UNSET);
+	/*
+	 * createparam() doesn't return anything if the parameter
+	 * already existed.
+	 */
+	if (!v->pm)
+	    v->pm = (Param) paramtab->getnode(paramtab, *aptr);
 	zsfree(*aptr++);
 	/* ...but we can use the value without copying. */
 	setstrvalue(v, *aptr++);