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.
This commit is contained in:
Wayne Davison 2001-05-19 09:22:07 +00:00
parent 90a1316345
commit 7e17db1fdc
1 changed files with 2 additions and 2 deletions

View File

@ -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);