Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Error in zshaddhistory() should not prevent command from running
- X-seq: zsh-workers 40253
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Error in zshaddhistory() should not prevent command from running
- Date: Wed, 28 Dec 2016 16:41:39 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=resent-from:resent-message-id:resent-date:resent-to:from:message-id :date:to:subject:mime-version; bh=du+yCfaV1KODf2nm/Z6yYGfHZDYlUNf5kEcFqPv/DAc=; b=b44xCuLaVKdWJRxzwob4/x0zTNwMTCSv7aIhOehjYRrsXDtvWkqdd1kMPM3hWjeRPP F/NmtmDtnDeRNTQ9X20SaVUY3WLaFaLXefxQKNAptVmnDT2O5ZPH1xbxlrM9Cwiqeutu 8wHA+Ycbxi/zJe7YSkLvTUICjsP6K8+Fp0z2C2lkatsNQWl0hCsPcr1QIlT2gnrAm5S/ H32cILkr2YTAXdK/uUdiEZ1cBLZDnIXBbqxT9BOPMdpd8OozU2TqmD6LwlNi4XwYG68I SrLI0OpkXuoHJ0XLYvffwzoVAN4E2E2vGUXn8Sv+OldodP2q4AO71lQWxSQ2KpG2utY6 LShw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Should this actually be in callhookfunc() itself? I note that the doc
warns about errors in precmd killing off periodic, or else I'd say it
ought to be.
Possibly more controversial, why run this hook at all when nothing is
being added?
diff --git a/Src/hist.c b/Src/hist.c
index 97fd340..350688d 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -1418,7 +1418,7 @@ hend(Eprog prog)
DPUTS(hptr < chline, "History end pointer off start of line");
*hptr = '\0';
}
- {
+ if (*chline) {
LinkList hookargs = newlinklist();
int save_errflag = errflag;
errflag = 0;
@@ -1427,6 +1427,7 @@ hend(Eprog prog)
addlinknode(hookargs, chline);
callhookfunc("zshaddhistory", hookargs, 1, &hookret);
+ errflag &= ~ERRFLAG_ERROR;
errflag |= save_errflag;
}
/* For history sharing, lock history file once for both read and write */
Messages sorted by:
Reverse Date,
Date,
Thread,
Author