1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-28 15:01:21 +02:00

22715: AUTOCONTINUE option never worked.

This commit is contained in:
Peter Stephenson 2006-09-15 16:27:07 +00:00
parent 0d4a9f65f7
commit bd4b21bf46
2 changed files with 18 additions and 8 deletions

@ -1,5 +1,7 @@
2006-09-15 Peter Stephenson <pws@csr.com>
* 22715: Src/exec.c: AUTOCONTINUE option never worked.
* 22713: Src/Zle/zle_tricky.c: word end in math completion context
was screwy.

@ -1838,7 +1838,7 @@ execcmd(Estate state, int input, int output, int how, int last1)
int nullexec = 0, assign = 0, forked = 0;
int is_shfunc = 0, is_builtin = 0, is_exec = 0, use_defpath = 0;
/* Various flags to the command. */
int cflags = 0, checked = 0, oautocont = opts[AUTOCONTINUE];
int cflags = 0, checked = 0, oautocont = -1;
LinkList redir;
wordcode code;
Wordcode beg = state->pc, varspc;
@ -1873,8 +1873,10 @@ execcmd(Estate state, int input, int output, int how, int last1)
* reference to a job in the job table. */
if (type == WC_SIMPLE && args && nonempty(args) &&
*(char *)peekfirst(args) == '%') {
if (how & Z_DISOWN)
if (how & Z_DISOWN) {
oautocont = opts[AUTOCONTINUE];
opts[AUTOCONTINUE] = 1;
}
pushnode(args, dupstring((how & Z_DISOWN)
? "disown" : (how & Z_ASYNC) ? "bg" : "fg"));
how = Z_SYNC;
@ -2060,7 +2062,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
if (cflags & BINF_BUILTIN) {
zwarn("no such builtin: %s", cmdarg);
lastval = 1;
opts[AUTOCONTINUE] = oautocont;
if (oautocont >= 0)
opts[AUTOCONTINUE] = oautocont;
return;
}
break;
@ -2084,7 +2087,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
if (errflag) {
lastval = 1;
opts[AUTOCONTINUE] = oautocont;
if (oautocont >= 0)
opts[AUTOCONTINUE] = oautocont;
return;
}
@ -2128,7 +2132,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
if (errflag) {
lastval = 1;
opts[AUTOCONTINUE] = oautocont;
if (oautocont >= 0)
opts[AUTOCONTINUE] = oautocont;
return;
}
@ -2212,7 +2217,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
if ((pid = zfork(&bgtime)) == -1) {
close(synch[0]);
close(synch[1]);
opts[AUTOCONTINUE] = oautocont;
if (oautocont >= 0)
opts[AUTOCONTINUE] = oautocont;
return;
} if (pid) {
close(synch[1]);
@ -2238,7 +2244,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
}
}
addproc(pid, text, 0, &bgtime);
opts[AUTOCONTINUE] = oautocont;
if (oautocont >= 0)
opts[AUTOCONTINUE] = oautocont;
return;
}
/* pid == 0 */
@ -2676,7 +2683,8 @@ execcmd(Estate state, int input, int output, int how, int last1)
zsfree(STTYval);
STTYval = 0;
opts[AUTOCONTINUE] = oautocont;
if (oautocont >= 0)
opts[AUTOCONTINUE] = oautocont;
}
/* Arrange to have variables restored. */