summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1997-11-16 12:07:29 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1997-11-16 12:07:29 +0000
commit160194a6c350aaedfb4826afe24d22da584c3ef1 (patch)
treeb68310d4f51bcae6f5d8fafbac3658fb3a157f21 /bin
parent8a0191fee26ee340bc05b92e18b5af4cc299a5d1 (diff)
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.
Diffstat (limited to 'bin')
-rw-r--r--bin/ksh/mail.c10
-rw-r--r--bin/pdksh/mail.c10
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));