1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-23 04:30:24 +02:00

Don't merge a HIST_TMPSTORE entry with a previous "duplicate" line.

Also, don't call addhistnode() on a HIST_TMPSTORE entry.
This commit is contained in:
Wayne Davison 2001-05-19 09:22:10 +00:00
parent 7e17db1fdc
commit f99520aeb0

View file

@ -1096,8 +1096,8 @@ hend(Eprog prog)
histreduceblanks();
}
newflags = save > 0? 0 : HIST_OLD | HIST_TMPSTORE;
if ((isset(HISTIGNOREDUPS) || isset(HISTIGNOREALLDUPS)) && hist_ring
&& histstrcmp(chline, hist_ring->text) == 0) {
if ((isset(HISTIGNOREDUPS) || isset(HISTIGNOREALLDUPS)) && save > 0
&& hist_ring && histstrcmp(chline, hist_ring->text) == 0) {
/* This history entry compares the same as the previous.
* In case minor changes were made, we overwrite the
* previous one with the current one. This also gets the
@ -1119,7 +1119,8 @@ hend(Eprog prog)
he->words = (short *)zalloc(chwordpos * sizeof(short));
memcpy(he->words, chwords, chwordpos * sizeof(short));
}
addhistnode(histtab, he->text, he);
if (!(newflags & HIST_TMPSTORE))
addhistnode(histtab, he->text, he);
}
zfree(chline, hlinesz);
zfree(chwords, chwordlen*sizeof(short));