about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2001-05-19 09:22:10 +0000
committerWayne Davison <wayned@users.sourceforge.net>2001-05-19 09:22:10 +0000
commitf99520aeb0d8cd817b9f7202d8c023dca06dbf1f (patch)
treeafc0b497fdf52a691ca33b0ffaba9bd18d76c6b4
parent7e17db1fdc5a511d8b4d19f2dc0a3fe2860df760 (diff)
downloadzsh-f99520aeb0d8cd817b9f7202d8c023dca06dbf1f.tar.gz
zsh-f99520aeb0d8cd817b9f7202d8c023dca06dbf1f.tar.xz
zsh-f99520aeb0d8cd817b9f7202d8c023dca06dbf1f.zip
Don't merge a HIST_TMPSTORE entry with a previous "duplicate" line.
Also, don't call addhistnode() on a HIST_TMPSTORE entry.
-rw-r--r--Src/hist.c7
1 files changed, 4 insertions, 3 deletions
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));