summaryrefslogtreecommitdiff
path: root/bin/ksh/exec.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-07-14 13:37:25 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-07-14 13:37:25 +0000
commitb1e130a5dfda09ae8a7ebe9ef8b2b31a7ea0072d (patch)
tree50a19d3ae6026d39eef62c7403512f3944b5de49 /bin/ksh/exec.c
parent9f95e00383dedac23c9855efa31e7556dd79de4c (diff)
pdksh-5.2.14
Diffstat (limited to 'bin/ksh/exec.c')
-rw-r--r--bin/ksh/exec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/ksh/exec.c b/bin/ksh/exec.c
index d59b5062926..9b9d575209a 100644
--- a/bin/ksh/exec.c
+++ b/bin/ksh/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.18 1999/06/23 10:30:51 millert Exp $ */
+/* $OpenBSD: exec.c,v 1.19 1999/07/14 13:37:23 millert Exp $ */
/*
* execute command tree
@@ -96,7 +96,7 @@ execute(t, flags)
}
*/
if ((flags&XFORK) && !(flags&XEXEC) && t->type != TPIPE)
- return exchild(t, flags, -1); /* run in sub-process */
+ return exchild(t, flags & ~XTIME, -1); /* run in sub-process */
newenv(E_EXEC);
if (trap)
@@ -114,6 +114,9 @@ execute(t, flags)
* and assignments last..
*/
ap = eval(t->args, t->u.evalflags | DOBLANK | DOGLOB | DOTILDE);
+ if (flags & XTIME)
+ /* Allow option parsing (bizarre, but POSIX) */
+ timex_hook(t, &ap);
if (Flag(FXTRACE) && ap[0]) {
shf_fprintf(shl_out, "%s",
PS4_SUBSTITUTE(str_val(global("PS4"))));
@@ -125,6 +128,7 @@ execute(t, flags)
if (ap[0])
tp = findcom(ap[0], FC_BI|FC_FUNC);
}
+ flags &= ~XTIME;
if (t->ioact != NULL || t->type == TPIPE || t->type == TCOPROC) {
e->savefd = (short *) alloc(sizeofN(short, NUFILE), ATEMP);