about summary refs log tree commit diff
path: root/Src/hist.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2002-02-16 09:21:34 +0000
committerWayne Davison <wayned@users.sourceforge.net>2002-02-16 09:21:34 +0000
commitd35af383df7bed6fe1ca8cb017264eb9030d2991 (patch)
tree51232354cb527bf66cfb3dd8b006eea331926bf4 /Src/hist.c
parent3fd91a7b905e4447396e22a09ed99b22ea994594 (diff)
downloadzsh-d35af383df7bed6fe1ca8cb017264eb9030d2991.tar.gz
zsh-d35af383df7bed6fe1ca8cb017264eb9030d2991.tar.xz
zsh-d35af383df7bed6fe1ca8cb017264eb9030d2991.zip
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).
Diffstat (limited to 'Src/hist.c')
-rw-r--r--Src/hist.c3
1 files changed, 2 insertions, 1 deletions
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;