From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15389 invoked from network); 8 Jun 2001 00:27:19 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Jun 2001 00:27:19 -0000 Received: (qmail 24488 invoked by alias); 8 Jun 2001 00:26:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14793 Received: (qmail 24474 invoked from network); 8 Jun 2001 00:26:57 -0000 Date: Thu, 7 Jun 2001 17:26:43 -0700 (PDT) From: Wayne Davison X-X-Sender: To: Zsh Workers Subject: Fix incremental append history after discarded command Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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---