Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: vanishing history
- X-seq: zsh-users 4678
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Adam Spiers <adam@xxxxxxxxxx>
- Subject: Re: vanishing history
- Date: Sat, 16 Feb 2002 01:28:25 -0800 (PST)
- Cc: zsh users mailing list <zsh-users@xxxxxxxxxxxxxx>
- In-reply-to: <20011128161905.A9726@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
On Wed, 28 Nov 2001, Adam Spiers wrote:
> Does anyone have any idea why my .zshhistory occasionally looses the
> vast majority of its contents? I can't reproduce it, so I can't begin
> to track down what's going on.
I've seen this from time to time, but also have been unable to reproduce
it. In pouring over the code I did finally see one potential way that
the loss of contents could happen: if the history file is locked by
another process while we're trying to rewrite it. Here's the fix (which
causes us to just punt on the rewrite if we read nothing):
Index: Src/hist.c
--- Src/hist.c 16 Feb 2002 09:15:07 -0000 1.39
+++ Src/hist.c 16 Feb 2002 09:21:16 -0000
@@ -2083,7 +2083,8 @@
hist_ignore_all_dups |= isset(HISTSAVENODUPS);
readhistfile(fn, err, 0);
hist_ignore_all_dups = isset(HISTIGNOREALLDUPS);
- savehistfile(fn, err, 0);
+ if (histlinect)
+ savehistfile(fn, err, 0);
deletehashtable(histtab);
curhist = remember_curhist;
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author