1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-02 10:01:11 +02:00

53454: fix interrupt handling in savehistfile()

This commit is contained in:
Bart Schaefer 2025-04-15 10:03:23 -07:00
parent ba1473181f
commit bacc78ec3f
2 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,7 @@
2025-04-15 Bart Schaefer <schaefer@zsh.org>
* 53454: Src/hist.c: fix interrupt handling in savehistfile()
2025-04-15 Eric Cook <illua@users.sourceforge.net>
* 53485: NEWS: update for version 5.10

View file

@ -2838,11 +2838,12 @@ readhistfile(char *fn, int err, int readflags)
*/
if (uselex || remeta)
freeheap();
if (errflag & ERRFLAG_INT) {
/* Can't assume fast read next time if interrupted. */
lasthist.interrupted = 1;
if (errflag & ERRFLAG_INT)
break;
}
}
if (errflag & ERRFLAG_INT) {
/* Can't assume fast read next time if interrupted. */
lasthist.interrupted = 1;
}
if (start && readflags & HFILE_USE_OPTIONS) {
zsfree(lasthist.text);
@ -3108,7 +3109,9 @@ savehistfile(char *fn, int err, int writeflags)
hist_ignore_all_dups |= isset(HISTSAVENODUPS);
readhistfile(fn, err, 0);
hist_ignore_all_dups = isset(HISTIGNOREALLDUPS);
if (histlinect)
if (errflag & ERRFLAG_INT)
ret = -1;
else if (histlinect)
savehistfile(fn, err, 0);
pophiststack();