mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-22 04:31:14 +02:00
25587: fix a==(stuff) and associated stuff.
This commit is contained in:
parent
2c9138bc21
commit
1f81bdcb47
4 changed files with 28 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2008-09-01 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
|
* 25587: Src/exec.c, Src/parse.c, Src/subst.c: foo==(stuff)
|
||||||
|
was mishandled owing to parse errors; mishandling it caused
|
||||||
|
a crash because of lack of care on failure of process
|
||||||
|
substitution; assignments that went through execcmd() failed
|
||||||
|
to set the status.
|
||||||
|
|
||||||
2008-09-01 Clint Adams <clint@zsh.org>
|
2008-09-01 Clint Adams <clint@zsh.org>
|
||||||
|
|
||||||
* 25585: Completion/Unix/Command/_git: fix git command completion
|
* 25585: Completion/Unix/Command/_git: fix git command completion
|
||||||
|
|
|
@ -2220,6 +2220,7 @@ execcmd(Estate state, int input, int output, int how, int last1)
|
||||||
doneps4 = 0;
|
doneps4 = 0;
|
||||||
redir = (wc_code(*state->pc) == WC_REDIR ? ecgetredirs(state) : NULL);
|
redir = (wc_code(*state->pc) == WC_REDIR ? ecgetredirs(state) : NULL);
|
||||||
if (wc_code(*state->pc) == WC_ASSIGN) {
|
if (wc_code(*state->pc) == WC_ASSIGN) {
|
||||||
|
cmdoutval = 0;
|
||||||
varspc = state->pc;
|
varspc = state->pc;
|
||||||
while (wc_code((code = *state->pc)) == WC_ASSIGN)
|
while (wc_code((code = *state->pc)) == WC_ASSIGN)
|
||||||
state->pc += (WC_ASSIGN_TYPE(code) == WC_ASSIGN_SCALAR ?
|
state->pc += (WC_ASSIGN_TYPE(code) == WC_ASSIGN_SCALAR ?
|
||||||
|
@ -2236,6 +2237,12 @@ execcmd(Estate state, int input, int output, int how, int last1)
|
||||||
* they don't modify their argument strings. */
|
* they don't modify their argument strings. */
|
||||||
args = (type == WC_SIMPLE ?
|
args = (type == WC_SIMPLE ?
|
||||||
ecgetlist(state, WC_SIMPLE_ARGC(code), EC_DUP, &htok) : NULL);
|
ecgetlist(state, WC_SIMPLE_ARGC(code), EC_DUP, &htok) : NULL);
|
||||||
|
/*
|
||||||
|
* If assignment but no command get the status from variable
|
||||||
|
* assignment.
|
||||||
|
*/
|
||||||
|
if (!args && varspc)
|
||||||
|
lastval = errflag ? errflag : cmdoutval;
|
||||||
|
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
save[i] = -2;
|
save[i] = -2;
|
||||||
|
|
12
Src/parse.c
12
Src/parse.c
|
@ -1567,6 +1567,18 @@ par_simple(int *complex, int nr)
|
||||||
str = p + 1;
|
str = p + 1;
|
||||||
} else
|
} else
|
||||||
equalsplit(tokstr, &str);
|
equalsplit(tokstr, &str);
|
||||||
|
for (p = str; *p; p++) {
|
||||||
|
/*
|
||||||
|
* We can't treat this as "simple" if it contains
|
||||||
|
* expansions that require process subsitution, since then
|
||||||
|
* we need process handling.
|
||||||
|
*/
|
||||||
|
if (p[1] == Inpar &&
|
||||||
|
(*p == Equals || *p == Inang || *p == Outang)) {
|
||||||
|
*complex = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
ecstr(name);
|
ecstr(name);
|
||||||
ecstr(str);
|
ecstr(str);
|
||||||
isnull = 0;
|
isnull = 0;
|
||||||
|
|
|
@ -66,6 +66,7 @@ prefork(LinkList list, int flags)
|
||||||
else
|
else
|
||||||
setdata(node, (void *) getoutputfile(str)); /* =(...) */
|
setdata(node, (void *) getoutputfile(str)); /* =(...) */
|
||||||
if (!getdata(node)) {
|
if (!getdata(node)) {
|
||||||
|
setdata(node, dupstring(""));
|
||||||
unqueue_signals();
|
unqueue_signals();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue