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 40249
- 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=S3FCJo6KyHx4izuDzEGBXEQLK7w1zGD4Blr4PTwr/92RNXaK7dBwidvuE71nDOFnet nbYiG4sN/3MIFawHl1JSGw6yJglVwhvCAwtfhPZLZJuBYT48kHh4SqJem7YDpbEld3Qg St5Ef+UYMYXZUqvUmx8ky1TAFlus46AnRsezf78WkuKooFJY8lRGyi5099LnrNNPYzc6 DeJptSMgoKMCPcedZPA6I/tvbwocgFdC0vz2QMEbXGDyRaEWrvuVKZm/NU2m/qouHg8l PeLrxv4JRS4EPrv4FywRD4fH4oyHAq4gj7ZePmQ9k+VSY0dzYVUopuqIr/xH3RkeXbdz dYEA==
- 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