Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Don't define internal params directly in hook function scope
- X-seq: zsh-workers 35002
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: Don't define internal params directly in hook function scope
- Date: Thu, 30 Apr 2015 02:08:03 +0200
- 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==
- In-reply-to: <CAHYJk3Q8gJWs=YKw7AtvqoyzGnn9Qbm2nFwLgzqBCnNwzmAQJQ@mail.gmail.com>
- 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
- References: <CAHYJk3Q8gJWs=YKw7AtvqoyzGnn9Qbm2nFwLgzqBCnNwzmAQJQ@mail.gmail.com>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author