about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-17 09:34:45 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-17 09:34:45 +0000
commit3250a1932b5984b8801b62f81ab8413dd347bc5f (patch)
tree4c511bc8b1206947a3c296070fd93be3162d65b1 /Src/Zle
parent5916a06121fe5d21f4ba73305e10f6686c77e28e (diff)
downloadzsh-3250a1932b5984b8801b62f81ab8413dd347bc5f.tar.gz
zsh-3250a1932b5984b8801b62f81ab8413dd347bc5f.tar.xz
zsh-3250a1932b5984b8801b62f81ab8413dd347bc5f.zip
zsh-workers/9329
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/complete.c21
-rw-r--r--Src/Zle/zleparameter.c2
2 files changed, 15 insertions, 8 deletions
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index fa1476a90..d4c9f76c8 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -1133,14 +1133,21 @@ static void
 compunsetfn(Param pm, int exp)
 {
     if (exp) {
-	if (PM_TYPE(pm->flags) == PM_SCALAR) {
-	    zsfree(*((char **) pm->u.data));
-	    *((char **) pm->u.data) = ztrdup("");
-	} else if (PM_TYPE(pm->flags) == PM_ARRAY) {
-	    freearray(*((char ***) pm->u.data));
-	    *((char ***) pm->u.data) = zcalloc(sizeof(char *));
+	if (pm->u.data) {
+	    if (PM_TYPE(pm->flags) == PM_SCALAR) {
+		zsfree(*((char **) pm->u.data));
+		*((char **) pm->u.data) = ztrdup("");
+	    } else if (PM_TYPE(pm->flags) == PM_ARRAY) {
+		freearray(*((char ***) pm->u.data));
+		*((char ***) pm->u.data) = zcalloc(sizeof(char *));
+	    } else if (PM_TYPE(pm->flags) == PM_HASHED) {
+		deleteparamtable(pm->u.hash);
+		pm->u.hash = NULL;
+	    }
 	}
-	pm->flags |= PM_UNSET;
+    } else if (PM_TYPE(pm->flags) == PM_HASHED) {
+	deletehashtable(pm->u.hash);
+	pm->u.hash = NULL;
     }
 }
 
diff --git a/Src/Zle/zleparameter.c b/Src/Zle/zleparameter.c
index d10fe99b1..1ef3c1b40 100644
--- a/Src/Zle/zleparameter.c
+++ b/Src/Zle/zleparameter.c
@@ -54,7 +54,7 @@ createspecialhash(char *name, GetNodeFunc get, ScanTabFunc scan)
     pm->gets.hfn = hashgetfn;
     pm->sets.hfn = hashsetfn;
     pm->unsetfn = stdunsetfn;
-    pm->u.hash = ht = newhashtable(7, name, NULL);
+    pm->u.hash = ht = newhashtable(0, name, NULL);
 
     ht->hash        = hasher;
     ht->emptytable  = (TableFunc) shempty;