From 7e17db1fdc5a511d8b4d19f2dc0a3fe2860df760 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 19 May 2001 09:22:07 +0000 Subject: [PATCH] The function addhistnode() is no longer called for a HIST_TMPSTORE entry, so I removed the checking for that flag. Also, freehistdata() now avoids calling removehashnode() on a HIST_TMPSTORE entry. --- Src/hashtable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/hashtable.c b/Src/hashtable.c index e88bc2477..c75a406e6 100644 --- a/Src/hashtable.c +++ b/Src/hashtable.c @@ -1480,7 +1480,7 @@ addhistnode(HashTable ht, char *nam, void *nodeptr) HashNode oldnode = addhashnode2(ht, nam, nodeptr); Histent he = (Histent)nodeptr; if (oldnode && oldnode != (HashNode)nodeptr) { - if (he->flags & (HIST_MAKEUNIQUE | HIST_TMPSTORE) + if (he->flags & HIST_MAKEUNIQUE || (he->flags & HIST_FOREIGN && (Histent)oldnode == he->up)) { (void) addhashnode2(ht, oldnode->nam, oldnode); /* restore hash */ he->flags |= HIST_DUP; @@ -1511,7 +1511,7 @@ freehistdata(Histent he, int unlink) if (!he) return; - if (!(he->flags & HIST_DUP)) + if (!(he->flags & (HIST_DUP | HIST_TMPSTORE))) removehashnode(histtab, he->text); zsfree(he->text);