about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2001-05-10 23:06:54 +0000
committerWayne Davison <wayned@users.sourceforge.net>2001-05-10 23:06:54 +0000
commit6066bd7eeb64b131d1e05a6f04f1304e334e36c7 (patch)
treef8b547f7779fe82bc49b592b27338308af3d575f
parent69f010c8c92eba662125b214037b22b3ecd63a9a (diff)
downloadzsh-6066bd7eeb64b131d1e05a6f04f1304e334e36c7.tar.gz
zsh-6066bd7eeb64b131d1e05a6f04f1304e334e36c7.tar.xz
zsh-6066bd7eeb64b131d1e05a6f04f1304e334e36c7.zip
Fixed an obscure local-history bug that could make the "history"
command output something that was slightly wrong. (14304)
-rw-r--r--Src/hist.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Src/hist.c b/Src/hist.c
index 58fe748be..f662ed9af 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -1067,8 +1067,6 @@ hend(Eprog prog)
 	Histent he;
 	int keepflags;
 
-	for (he = hist_ring; he && he->flags & hist_skip_flags;
-	     he = up_histent(he)) ;
 #ifdef DEBUG
 	/* debugging only */
 	if (chwordpos%2) {
@@ -1083,13 +1081,14 @@ hend(Eprog prog)
 	    if (isset(HISTREDUCEBLANKS))
 		histreduceblanks();
 	}
-	if ((isset(HISTIGNOREDUPS) || isset(HISTIGNOREALLDUPS)) && he
-	 && histstrcmp(chline, he->text) == 0) {
+	if ((isset(HISTIGNOREDUPS) || isset(HISTIGNOREALLDUPS)) && 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
 	     * timestamp right.  Perhaps, preserve the HIST_OLD flag.
 	     */
+	    he = hist_ring;
 	    keepflags = he->flags & HIST_OLD; /* Avoid re-saving */
 	    freehistdata(he, 0);
 	    curline.histnum = curhist;