From f99520aeb0d8cd817b9f7202d8c023dca06dbf1f Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 19 May 2001 09:22:10 +0000 Subject: Don't merge a HIST_TMPSTORE entry with a previous "duplicate" line. Also, don't call addhistnode() on a HIST_TMPSTORE entry. --- Src/hist.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Src/hist.c') diff --git a/Src/hist.c b/Src/hist.c index 09a043d4d..1b4828e82 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -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)); -- cgit 1.4.1