zsh-workers
 help / color / mirror / code / Atom feed
* Fix incremental append history after discarded command
@ 2001-06-08  0:26 Wayne Davison
  0 siblings, 0 replies; only message in thread
From: Wayne Davison @ 2001-06-08  0:26 UTC (permalink / raw)
  To: Zsh Workers

The current code has a bug where a discarded history line can cause the
next non-discarded line to not be immediately output to the history file
when inc-append-history or share-history is enabled (it is output later
when the file is rewritten).

The fix is simple:  don't mark the HIST_TMPSTORE line with HIST_OLD.
This avoids having the HFILE_FAST algorithm in histsavefile() update
its high-water mark.

I think this change should be checked into the 4.0 patch branch, and I'd
be glad to do that.

..wayne..

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
Index: Src/hist.c
--- Src/hist.c	2001/05/19 09:22:10	1.28
+++ Src/hist.c	2001/06/08 00:00:28
@@ -1095,7 +1095,7 @@
 	    if (isset(HISTREDUCEBLANKS))
 		histreduceblanks();
 	}
-	newflags = save > 0? 0 : HIST_OLD | HIST_TMPSTORE;
+	newflags = save > 0? 0 : HIST_TMPSTORE;
 	if ((isset(HISTIGNOREDUPS) || isset(HISTIGNOREALLDUPS)) && save > 0
 	 && hist_ring && histstrcmp(chline, hist_ring->text) == 0) {
 	    /* This history entry compares the same as the previous.
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-06-08  0:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-08  0:26 Fix incremental append history after discarded command Wayne Davison

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).