Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] REPORTTIME parsed as 0 with error in zle widget
- X-seq: zsh-workers 42362
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: Re: [BUG] REPORTTIME parsed as 0 with error in zle widget
- Date: Mon, 12 Feb 2018 20:28:37 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1518467318; bh=8D+Tm3ujv6aW8S2pZ0CoyEhiPITWTxUqdLjRkYMgRUM=; h=Date:From:To:Subject:In-Reply-To:References; b=zug+3X70f3MzRKjrQK85tzNgT5ccE/KOn75u4ucRkaouPgf2+7rjaVVTuQow7MROM z92buCZhwN9FLgjP1pLHiH9mJmuCv4sxiYive7m+zf50EXAUvIpAyOJ4ictTtlbkcg SPpp8NzIABXOzt/HiEdTmrlC4mmfwzUvzDqN8DnOAhuVCzmI2cYkpG9YgyK3M7f2w+ epUTX4Tg7eRm6iUIa76n/g+nVCKPYty6pPqw0Og+922Qi+FQD0NS51AVOk2pfaLfX7 VG/SLg4dceqfH5I+MdXuNgieXVoXcD3atymEQOOZlLZycKwUqetnw3IkrYK3Q9RacN hIFAb99xJ9QQg==
- In-reply-to: <6de993f2-b9ab-19ba-fa2c-417377a4e6f8@thequod.de>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <6de993f2-b9ab-19ba-fa2c-417377a4e6f8@thequod.de>
On Mon, 12 Feb 2018 10:05:08 +0100
Daniel Hahler <genml+zsh-workers@xxxxxxxxxx> wrote:
> Given the following zle widget:
> getintvalue in should_report_time returns 0, although getstrvalue(v) is "5"!
> This is caused by errflag being set in matheval, which makes it return 0!
> And this gets caused by "exit 130" in __fsel.
This is probably too deep in jobs.c for anyone to have noticed it needed
protection like a lot of other functions already have.
pws
diff --git a/Src/jobs.c b/Src/jobs.c
index fc5bfac..503618f 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -925,6 +925,7 @@ should_report_time(Job j)
struct value vbuf;
Value v;
char *s = "REPORTTIME";
+ int save_errflag = errflag;
zlong reporttime = -1;
#ifdef HAVE_GETRUSAGE
char *sm = "REPORTMEMORY";
@@ -936,12 +937,14 @@ should_report_time(Job j)
return 1;
queue_signals();
+ errflag = 0;
if ((v = getvalue(&vbuf, &s, 0)))
reporttime = getintvalue(v);
#ifdef HAVE_GETRUSAGE
if ((v = getvalue(&vbuf, &sm, 0)))
reportmemory = getintvalue(v);
#endif
+ errflag = save_errflag;
unqueue_signals();
if (reporttime < 0
#ifdef HAVE_GETRUSAGE
Messages sorted by:
Reverse Date,
Date,
Thread,
Author