diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1997-01-02 17:37:28 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1997-01-02 17:37:28 +0000 |
commit | 05bd5e92fd8cb8af4e628fb7e1bab262b49399d0 (patch) | |
tree | 3422037820bdf481f3b3ee8677591c6be94da5cd /bin/ksh | |
parent | 65fb1a64047e6f8aa4639dce100459b243fe4659 (diff) |
After discussing $_ with the maintainer, revert ksh behaviour and completely
eliminate it from sh.
Diffstat (limited to 'bin/ksh')
-rw-r--r-- | bin/ksh/exec.c | 7 | ||||
-rw-r--r-- | bin/ksh/history.c | 4 | ||||
-rw-r--r-- | bin/ksh/mail.c | 5 |
3 files changed, 8 insertions, 8 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); } diff --git a/bin/ksh/history.c b/bin/ksh/history.c index f29e7e7d281..295f108f130 100644 --- a/bin/ksh/history.c +++ b/bin/ksh/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.3 1997/01/02 09:34:00 downsj Exp $ */ +/* $OpenBSD: history.c,v 1.4 1997/01/02 17:37:26 downsj Exp $ */ /* * command history @@ -242,7 +242,7 @@ c_fc(wp) return 1; } - if (!Flag(FSH) || Flag(FTALKING)) + if (!Flag(FSH)) setstr(local("_", FALSE), tf->name); /* XXX: source should not get trashed by this.. */ diff --git a/bin/ksh/mail.c b/bin/ksh/mail.c index a26bde87579..04033a4f2d3 100644 --- a/bin/ksh/mail.c +++ b/bin/ksh/mail.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mail.c,v 1.2 1996/08/19 20:08:55 downsj Exp $ */ +/* $OpenBSD: mail.c,v 1.3 1997/01/02 17:37:27 downsj Exp $ */ /* * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by @@ -180,7 +180,8 @@ mbox_t *mbp; { struct tbl *vp; - setstr((vp = local("_", FALSE)), mbp->mb_path); + if (!Flag(FSH)) + setstr((vp = local("_", FALSE)), mbp->mb_path); shellf("%s\n", substitute(mbp->mb_msg ? mbp->mb_msg : MBMESSAGE, 0)); |