From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11532 invoked by alias); 30 Apr 2015 00:08:20 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35002 Received: (qmail 22095 invoked from network); 30 Apr 2015 00:08:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=Xq2jDj8ohrzLEUcbnZSlveX1/DtmfLEdizpfBhVqsM8=; b=B2ikXrVCqkBsmTnOT/mTLUVE5/wgBMqH8syvL3aqv5nqrUqizwcdaz6QNgN7/fIAFb Q6UBp6YhpA4cbRyGOOOfJdIxjdBJ8vIdpwp4V5Iysu0a6aPpDBncin7+pU4djtCeVYj9 X45c5l5njwZSx47XUzLSFnd2FeZozw96mpZDRwvJb50upwbeASeQsKG03K7YBoRLkyxK oFABsyNRD04gVkYRdFDWyJKuxq0s3DQ51IQKmxuEfngdKJBxtelifZV6b0VMgrC00F1L Mwj1ZQ4tGHrnMwtK5BDL4xYM89/UGig6vI+o5ed39HPwFeoFF0Q7avVlMFZXN3Y4VRxe NyXw== X-Received: by 10.180.231.4 with SMTP id tc4mr311690wic.27.1430352492838; Wed, 29 Apr 2015 17:08:12 -0700 (PDT) From: Mikael Magnusson To: zsh-workers@zsh.org Subject: PATCH: Don't define internal params directly in hook function scope Date: Thu, 30 Apr 2015 02:08:03 +0200 Message-Id: <1430352483-30739-1-git-send-email-mikachu@gmail.com> X-Mailer: git-send-email 2.2.0.GIT In-Reply-To: References: Something feels very wrong about this :). I'm not committing it. (I didn't investigate this at all, it's just based on my observation that wrapping the local in an anonymous function helped, and this also works. It may blow up something). --- Src/Zle/compcore.c | 2 ++ Src/Zle/zle_main.c | 7 ++++++- Src/Zle/zle_misc.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c index f50c9e9..6816847 100644 --- a/Src/Zle/compcore.c +++ b/Src/Zle/compcore.c @@ -825,6 +825,7 @@ callcompfunc(char *s, char *fn) comp_setunset(rset, (~rset & CP_ALLREALS), kset, (~kset & CP_ALLKEYS)); makezleparams(1); + startparamscope(); sfcontext = SFC_CWIDGET; NEWHEAPS(compheap) { LinkList largs = NULL; @@ -841,6 +842,7 @@ callcompfunc(char *s, char *fn) } OLDHEAPS; sfcontext = osc; endparamscope(); + endparamscope(); lastcmd = 0; incompfunc = icf; diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index ef6a29d..71c7c24 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -1383,12 +1383,14 @@ execzlefunc(Thingy func, char **args, int set_bindk) } startparamscope(); makezleparams(0); + startparamscope(); sfcontext = SFC_WIDGET; opts[XTRACE] = 0; ret = doshfunc(shf, largs, 1); opts[XTRACE] = oxt; sfcontext = osc; endparamscope(); + endparamscope(); lastcmd = 0; r = 1; redup(osi, 0); @@ -1878,6 +1880,7 @@ zlebeforetrap(UNUSED(Hookdef dummy), UNUSED(void *dat)) if (zleactive) { startparamscope(); makezleparams(1); + startparamscope(); } return 0; } @@ -1885,8 +1888,10 @@ zlebeforetrap(UNUSED(Hookdef dummy), UNUSED(void *dat)) static int zleaftertrap(UNUSED(Hookdef dummy), UNUSED(void *dat)) { - if (zleactive) + if (zleactive) { + endparamscope(); endparamscope(); + } return 0; } diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c index 4669ef2..b4e9f0e 100644 --- a/Src/Zle/zle_misc.c +++ b/Src/Zle/zle_misc.c @@ -1609,10 +1609,12 @@ iremovesuffix(ZLE_INT_T c, int keep) startparamscope(); makezleparams(0); + startparamscope(); sfcontext = SFC_COMPLETE; doshfunc(shfunc, args, 1); sfcontext = osc; endparamscope(); + endparamscope(); if (wasmeta) metafy_line(); -- 2.2.0.GIT