mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-04 22:51:42 +02:00
zsh-workers/10197
This commit is contained in:
parent
626e2aeb16
commit
73ca2634cf
2 changed files with 22 additions and 0 deletions
13
Src/exec.c
13
Src/exec.c
|
@ -2672,7 +2672,9 @@ getoutput(char *cmd, int qt)
|
|||
redup(pipes[1], 1);
|
||||
opts[MONITOR] = 0;
|
||||
entersubsh(Z_SYNC, 1, 0);
|
||||
cmdpush(CS_CMDSUBST);
|
||||
execode(prog, 0, 1);
|
||||
cmdpop();
|
||||
close(1);
|
||||
_exit(lastval);
|
||||
zerr("exit returned in child!!", NULL, 0);
|
||||
|
@ -2801,7 +2803,9 @@ getoutputfile(char *cmd)
|
|||
redup(fd, 1);
|
||||
opts[MONITOR] = 0;
|
||||
entersubsh(Z_SYNC, 1, 0);
|
||||
cmdpush(CS_CMDSUBST);
|
||||
execode(prog, 0, 1);
|
||||
cmdpop();
|
||||
close(1);
|
||||
_exit(lastval);
|
||||
zerr("exit returned in child!!", NULL, 0);
|
||||
|
@ -2885,7 +2889,9 @@ getproc(char *cmd)
|
|||
redup(pipes[out], out);
|
||||
closem(0); /* this closes pipes[!out] as well */
|
||||
#endif
|
||||
cmdpush(CS_CMDSUBST);
|
||||
execode(prog, 0, 1);
|
||||
cmdpop();
|
||||
zclose(out);
|
||||
_exit(lastval);
|
||||
return NULL;
|
||||
|
@ -2911,7 +2917,9 @@ getpipe(char *cmd)
|
|||
entersubsh(Z_ASYNC, 1, 0);
|
||||
redup(pipes[out], out);
|
||||
closem(0); /* this closes pipes[!out] as well */
|
||||
cmdpush(CS_CMDSUBST);
|
||||
execode(prog, 0, 1);
|
||||
cmdpop();
|
||||
_exit(lastval);
|
||||
return 0;
|
||||
}
|
||||
|
@ -2963,7 +2971,9 @@ execcond(Estate state, int do_exec)
|
|||
fprintf(xtrerr, "[[");
|
||||
tracingcond++;
|
||||
}
|
||||
cmdpush(CS_COND);
|
||||
stat = !evalcond(state);
|
||||
cmdpop();
|
||||
if (isset(XTRACE)) {
|
||||
fprintf(xtrerr, " ]]\n");
|
||||
fflush(xtrerr);
|
||||
|
@ -2986,6 +2996,7 @@ execarith(Estate state, int do_exec)
|
|||
printprompt4();
|
||||
fprintf(xtrerr, "((");
|
||||
}
|
||||
cmdpush(CS_MATH);
|
||||
e = ecgetstr(state, EC_DUPTOK, &htok);
|
||||
if (htok)
|
||||
singsub(&e);
|
||||
|
@ -2994,6 +3005,8 @@ execarith(Estate state, int do_exec)
|
|||
|
||||
val = mathevali(e);
|
||||
|
||||
cmdpop();
|
||||
|
||||
if (isset(XTRACE)) {
|
||||
fprintf(xtrerr, " ))\n");
|
||||
fflush(xtrerr);
|
||||
|
|
|
@ -904,6 +904,8 @@ source(char *s)
|
|||
int oldshst, osubsh, oloops;
|
||||
FILE *obshin;
|
||||
char *old_scriptname = scriptname, *us;
|
||||
char *ocs;
|
||||
int ocsp;
|
||||
|
||||
if (!s ||
|
||||
(!(prog = try_source_file((us = unmeta(s)))) &&
|
||||
|
@ -919,6 +921,10 @@ source(char *s)
|
|||
oldlineno = lineno; /* store our current lineno */
|
||||
oloops = loops; /* stored the # of nested loops we are in */
|
||||
oldshst = opts[SHINSTDIN]; /* store current value of this option */
|
||||
ocs = cmdstack;
|
||||
ocsp = cmdsp;
|
||||
cmdstack = (unsigned char *) zalloc(CMDSTACKSZ);
|
||||
cmdsp = 0;
|
||||
|
||||
if (!prog) {
|
||||
SHIN = tempfd;
|
||||
|
@ -957,6 +963,9 @@ source(char *s)
|
|||
errflag = 0;
|
||||
retflag = 0;
|
||||
scriptname = old_scriptname;
|
||||
free(cmdstack);
|
||||
cmdstack = ocs;
|
||||
cmdsp = ocsp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue