Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Fix incremental append history after discarded command
- X-seq: zsh-workers 14793
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Zsh Workers <zsh-workers@xxxxxxxxxx>
- Subject: Fix incremental append history after discarded command
- Date: Thu, 7 Jun 2001 17:26:43 -0700 (PDT)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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---
Messages sorted by:
Reverse Date,
Date,
Thread,
Author