From: Wayne Davison <wayned@users.sourceforge.net>
To: Zsh Workers <zsh-workers@sunsite.dk>
Subject: Fix incremental append history after discarded command
Date: Thu, 7 Jun 2001 17:26:43 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.33L2.0106071716440.12754-100000@phong.blorf.net> (raw)
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---
reply other threads:[~2001-06-08 0:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.33L2.0106071716440.12754-100000@phong.blorf.net \
--to=wayned@users.sourceforge.net \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).