summaryrefslogtreecommitdiff
path: root/bin/ksh/exec.c
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1997-01-02 17:37:28 +0000
committerJason Downs <downsj@cvs.openbsd.org>1997-01-02 17:37:28 +0000
commit05bd5e92fd8cb8af4e628fb7e1bab262b49399d0 (patch)
tree3422037820bdf481f3b3ee8677591c6be94da5cd /bin/ksh/exec.c
parent65fb1a64047e6f8aa4639dce100459b243fe4659 (diff)
After discussing $_ with the maintainer, revert ksh behaviour and completely
eliminate it from sh.
Diffstat (limited to 'bin/ksh/exec.c')
-rw-r--r--bin/ksh/exec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/ksh/exec.c b/bin/ksh/exec.c
index 079ccc93940..d84987cd41c 100644
--- a/bin/ksh/exec.c
+++ b/bin/ksh/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.6 1997/01/02 09:33:56 downsj Exp $ */
+/* $OpenBSD: exec.c,v 1.7 1997/01/02 17:37:25 downsj Exp $ */
/*
* execute command tree
@@ -457,14 +457,13 @@ comexec(t, tp, ap, flags)
int type_flags;
int keepasn_ok;
int fcflags = FC_BI|FC_FUNC|FC_PATH;
- volatile int underscore = (!Flag(FSH) || Flag(FTALKING));
/* snag the last argument for $_ XXX not the same as at&t ksh,
* which only seems to set $_ after a newline (but not in
* functions/dot scripts, but in interactive and scipt) -
* perhaps save last arg here and set it in shell()?.
*/
- if (underscore && *(lastp = ap)) {
+ if (!Flag(FSH) && *(lastp = ap)) {
while (*++lastp)
;
setstr(typeset("_", LOCAL, 0, 0, 0), *--lastp);
@@ -699,7 +698,7 @@ comexec(t, tp, ap, flags)
break;
}
- if (underscore) {
+ if (!Flag(FSH)) {
/* set $_ to program's full path */
setstr(typeset("_", LOCAL|EXPORT, 0, 0, 0), tp->val.s);
}