1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2026-01-01 20:11:06 +01:00

When rewriting the history file, set histactive to 0 and restore it

when we're done.  This prevents the loss of the file's last line
when a signal causes us to rewrite it.  Also restore the value of
histsiz.
This commit is contained in:
Wayne Davison 2001-08-07 19:53:19 +00:00
parent adbab91edb
commit f7e8ca1d96

View file

@ -2028,10 +2028,13 @@ savehistfile(char *fn, int err, int writeflags)
Histent remember_hist_ring = hist_ring;
int remember_histlinect = histlinect;
int remember_curhist = curhist;
int remember_histsiz = histsiz;
int remember_histactive = histactive;
hist_ring = NULL;
curhist = histlinect = 0;
histsiz = savehist;
histactive = 0;
createhisttable(); /* sets histtab */
hist_ignore_all_dups |= isset(HISTSAVENODUPS);
@ -2044,6 +2047,8 @@ savehistfile(char *fn, int err, int writeflags)
histlinect = remember_histlinect;
hist_ring = remember_hist_ring;
histtab = remember_histtab;
histsiz = remember_histsiz;
histactive = remember_histactive;
}
} else if (err)
zerr("can't write history file %s", fn, 0);