Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: DEBUG trap and warn_create_global
- X-seq: zsh-workers 42043
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: DEBUG trap and warn_create_global
- Date: Mon, 20 Nov 2017 17:45:11 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=angIkCW0wpdIqjfR/cJqh61ex1TpdHP+6tXTYVs7WMg=; b=U35IVeDauM5JztzwU7WxbKGXaE5B9xOJwKnLbdS3Sxa9c6li8eWLvcFWEcMlVurzAp NoKKq0rTE9mjjtE1smWZxblfcdXbjF+Nt7WpC0bPHvEwLTut+dviIASJaYulF95Nj5Ju PMotufq1+YV6ImIOuY7AUDQxeEIKHh2xBvP3//0FbO5YbNl9BwRukGg0o/AZqowUhLHd Jfyq5PgcGhodYaPrfXjzckv6forXg9BzfCTXa/O7SxHAjJRWbSoCwGBy4+HQJoSmRZ5i S/2G9pLkeThexhY/+QCeAjpX2mbXqFOhGoirGMu0Ec1GiPFxh4X2FZts0EUiOCyOItV4 6xjg==
- In-reply-to: <20171120040845.GA37154@CptOrmolo.darkstar>
- 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: <20171120040845.GA37154@CptOrmolo.darkstar>
On Sun, Nov 19, 2017 at 8:08 PM, Matthew Martin <phy1729@xxxxxxxxx> wrote:
>
> I would think ZSH_DEBUG_CMD is local to the trap execution. Otherwise
> DEBUG traps can "break" warn_create_global clean functions.
Hm. Making it implicitly local would change the behavior with respect
to "unset after the trap." I don't know how important that is.
However, it should be possible for it to be set without tripping the
warning, we just need to call assignsparam() instead of setsparam().
(Apologies if this gets wordwrapped or something, I don't have access
to my usual email client this week.)
diff --git a/Src/exec.c b/Src/exec.c
index fc6d02d..49da562 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1319,7 +1319,9 @@ execlist(Estate state, int dont_change_job, int exiting)
noerrexit = NOERREXIT_EXIT | NOERREXIT_RETURN;
if (ltype & Z_SIMPLE) /* skip the line number */
pc2++;
- pm = setsparam("ZSH_DEBUG_CMD", getpermtext(state->prog, pc2, 0));
+ pm = assignsparam("ZSH_DEBUG_CMD",
+ getpermtext(state->prog, pc2, 0),
+ 0);
exiting = donetrap;
ret = lastval;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author