1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 21:44:11 +01:00

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

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