diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-15 18:16:27 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-04-15 18:16:27 +0000 |
commit | b4a5b9db8b528f9c9b6a9cbb00db381c95659380 (patch) | |
tree | 17bf8f93d47de0af7495ec6d11361aef1ca62f9b /Src/exec.c | |
parent | ba4f5e80ec9d7e145718e79fed6e57a852c86c12 (diff) | |
download | zsh-b4a5b9db8b528f9c9b6a9cbb00db381c95659380.tar.gz zsh-b4a5b9db8b528f9c9b6a9cbb00db381c95659380.tar.xz zsh-b4a5b9db8b528f9c9b6a9cbb00db381c95659380.zip |
zsh-3.1.5-pws-9 zsh-3.1.5-pws-9
Diffstat (limited to 'Src/exec.c')
-rw-r--r-- | Src/exec.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/Src/exec.c b/Src/exec.c index bb331f426..59061af3f 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1208,7 +1208,7 @@ addvars(LinkList l, int export) addlinknode(vl, v->str); } else vl = v->arr; - prefork(vl, v->type == PM_SCALAR ? 7 : 3); + prefork(vl, v->type == PM_SCALAR ? (PF_SINGLE|PF_ASSIGN) : PF_ASSIGN); if (errflag) return; if (isset(GLOBASSIGN) || v->type != PM_SCALAR) @@ -1356,7 +1356,7 @@ execcmd(Cmd cmd, int input, int output, int how, int last1) } /* Do prefork substitutions */ - prefork(args, assign ? 2 : isset(MAGICEQUALSUBST)); + prefork(args, (assign || isset(MAGICEQUALSUBST)) ? PF_TYPESET : 0); if (type == SIMPLE) { int unglobbed = 0; @@ -2519,13 +2519,26 @@ spawnpipes(LinkList l) } } +extern int tracingcond; + /* evaluate a [[ ... ]] */ /**/ static int execcond(Cmd cmd) { - return !evalcond(cmd->u.cond); + int stat; + if (isset(XTRACE)) { + fprintf(stderr, "%s[[", prompt4 ? prompt4 : ""); + tracingcond++; + } + stat = !evalcond(cmd->u.cond); + if (isset(XTRACE)) { + fprintf(stderr, " ]]\n"); + fflush(stderr); + tracingcond--; + } + return stat; } /* evaluate a ((...)) arithmetic command */ @@ -2537,8 +2550,17 @@ execarith(Cmd cmd) char *e; long val = 0; - while ((e = (char *) ugetnode(cmd->args))) + if (isset(XTRACE)) + fprintf(stderr, "%s((", prompt4 ? prompt4 : ""); + while ((e = (char *) ugetnode(cmd->args))) { + if (isset(XTRACE)) + fprintf(stderr, " %s", e); val = matheval(e); + } + if (isset(XTRACE)) { + fprintf(stderr, " ))\n", stderr); + fflush(stderr); + } errflag = 0; return !val; } @@ -2613,6 +2635,18 @@ execshfunc(Cmd cmd, Shfunc shf) deletejob(jobtab + thisjob); } + if (isset(XTRACE)) { + LinkNode lptr; + fprintf(stderr, "%s", prompt4 ? prompt4 : prompt4); + for (lptr = firstnode(cmd->args); lptr; incnode(lptr)) { + if (lptr != firstnode(cmd->args)) + fputc(' ', stderr); + fprintf(stderr, "%s", (char *)getdata(lptr)); + } + fputc('\n', stderr); + fflush(stderr); + } + doshfunc(shf->nam, shf->funcdef, cmd->args, shf->flags, 0); if (!list_pipe) |