From d35af383df7bed6fe1ca8cb017264eb9030d2991 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 16 Feb 2002 09:21:34 +0000 Subject: When savehistfile() rewrites the history file, there was a potential for losing the entire history file if we couldn't lock the file for reading (it timed out) but we could lock the file for write (and wrote nothing). --- Src/hist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/hist.c b/Src/hist.c index 2598baa5c..c7b4641df 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -2083,7 +2083,8 @@ savehistfile(char *fn, int err, int writeflags) 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; -- cgit 1.4.1