diff options
author | 1997-11-16 12:07:28 +0000 | |
---|---|---|
committer | 1997-11-16 12:07:28 +0000 | |
commit | 0a9fc39cae4469594d463ba83a1286acb9568196 (patch) | |
tree | 999c0f5fab7020fb5e834b3c243c87c326791608 | |
parent | compile on alpha, needs testing (diff) | |
download | wireguard-openbsd-0a9fc39cae4469594d463ba83a1286acb9568196.tar.xz wireguard-openbsd-0a9fc39cae4469594d463ba83a1286acb9568196.zip |
Revert one of the $_ changes made 970102, as it makes sh crash when mail
arrives and mailchecking is on. I doubt this case was meant to be altered
at that time judging from the documentation fix it went along with.
However to be really sure I would like to see what POSIX has to say about
the mail notification message format. Is $_ meant to be expanded to the
mailbox path? If so, this revertion is correct, otherwise, another fix ought
to be made. I have no POSIX spec though.
-rw-r--r-- | bin/ksh/mail.c | 10 | ||||
-rw-r--r-- | bin/pdksh/mail.c | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/bin/ksh/mail.c b/bin/ksh/mail.c index fec22b8bb13..79ff7aee0f6 100644 --- a/bin/ksh/mail.c +++ b/bin/ksh/mail.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mail.c,v 1.5 1997/06/19 13:58:44 kstailey Exp $ */ +/* $OpenBSD: mail.c,v 1.6 1997/11/16 12:07:28 niklas Exp $ */ /* * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by @@ -180,7 +180,15 @@ mbox_t *mbp; { struct tbl *vp; +#if 0 + /* + * I doubt this $_ overloading is bad in /bin/sh mode. Anyhow, we + * crash as the code looks now if we do not set vp. Now, this is + * easy to fix too, but I'd like to see what POSIX says before doing + * a change like that. + */ if (!Flag(FSH)) +#endif setstr((vp = local("_", FALSE)), mbp->mb_path); shellf("%s\n", substitute(mbp->mb_msg ? mbp->mb_msg : MBMESSAGE, 0)); diff --git a/bin/pdksh/mail.c b/bin/pdksh/mail.c index fec22b8bb13..79ff7aee0f6 100644 --- a/bin/pdksh/mail.c +++ b/bin/pdksh/mail.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mail.c,v 1.5 1997/06/19 13:58:44 kstailey Exp $ */ +/* $OpenBSD: mail.c,v 1.6 1997/11/16 12:07:28 niklas Exp $ */ /* * Mailbox checking code by Robert J. Gibson, adapted for PD ksh by @@ -180,7 +180,15 @@ mbox_t *mbp; { struct tbl *vp; +#if 0 + /* + * I doubt this $_ overloading is bad in /bin/sh mode. Anyhow, we + * crash as the code looks now if we do not set vp. Now, this is + * easy to fix too, but I'd like to see what POSIX says before doing + * a change like that. + */ if (!Flag(FSH)) +#endif setstr((vp = local("_", FALSE)), mbp->mb_path); shellf("%s\n", substitute(mbp->mb_msg ? mbp->mb_msg : MBMESSAGE, 0)); |