summaryrefslogtreecommitdiff
path: root/usr.bin/mail/lex.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-11 12:54:26 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-11 12:54:26 +0000
commit1c5940ab5503bf389f03195f3d01a93353919abb (patch)
treea1e9691c11b7f36906f0943dc7d8464a56b98adc /usr.bin/mail/lex.c
parent5f733ec731243d90e1e65f27ce29e683e7a253a6 (diff)
from christos;
- Fix PR/105: Implement dot locking protocol and check return value of flock. - Fix PR/2247: Don't call unknown users "ubluit". Issue an error message. - Fix/add prototypes. - Fix warnings. - Use POSIX signal mask calls.
Diffstat (limited to 'usr.bin/mail/lex.c')
-rw-r--r--usr.bin/mail/lex.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c
index d5741a0bbfa..36dccc59a13 100644
--- a/usr.bin/mail/lex.c
+++ b/usr.bin/mail/lex.c
@@ -1,4 +1,5 @@
-/* $OpenBSD: lex.c,v 1.2 1996/03/27 19:32:33 niklas Exp $ */
+/* $OpenBSD: lex.c,v 1.3 1996/06/11 12:53:42 deraadt Exp $ */
+/* $NetBSD: lex.c,v 1.7 1996/06/08 19:48:28 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,8 +35,11 @@
*/
#ifndef lint
-static char sccsid[] = "from: @(#)lex.c 8.1 (Berkeley) 6/6/93";
-static char rcsid[] = "$OpenBSD: lex.c,v 1.2 1996/03/27 19:32:33 niklas Exp $";
+#if 0
+static char sccsid[] = "@(#)lex.c 8.1 (Berkeley) 6/6/93";
+#else
+static char rcsid[] = "$OpenBSD: lex.c,v 1.3 1996/06/11 12:53:42 deraadt Exp $";
+#endif
#endif /* not lint */
#include "rcv.h"
@@ -171,7 +175,10 @@ commands()
int eofloop = 0;
register int n;
char linebuf[LINESIZE];
- void intr(), stop(), hangup();
+#if __GNUC__
+ /* Avoid longjmp clobbering */
+ (void) &eofloop;
+#endif
if (!sourcing) {
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
@@ -249,7 +256,7 @@ execute(linebuf, contxt)
{
char word[LINESIZE];
char *arglist[MAXARGC];
- const struct cmd *com;
+ const struct cmd *com = NULL;
register char *cp, *cp2;
register int c;
int muvec[2];
@@ -301,7 +308,7 @@ execute(linebuf, contxt)
*/
if ((com->c_argtype & F) == 0)
- if (cond == CRCV && !rcvmode || cond == CSEND && rcvmode)
+ if ((cond == CRCV && !rcvmode) || (cond == CSEND && rcvmode))
return(0);
/*
@@ -424,6 +431,8 @@ out:
unstack();
return 0;
}
+ if (com == NULL)
+ return(0);
if (value("autoprint") != NOSTR && com->c_argtype & P)
if ((dot->m_flag & MDELETED) == 0) {
muvec[0] = dot - &message[0] + 1;
@@ -526,10 +535,13 @@ stop(s)
int s;
{
sig_t old_action = signal(s, SIG_DFL);
+ sigset_t nset;
- sigsetmask(sigblock(0) & ~sigmask(s));
+ sigemptyset(&nset);
+ sigaddset(&nset, s);
+ sigprocmask(SIG_UNBLOCK, &nset, NULL);
kill(0, s);
- sigblock(sigmask(s));
+ sigprocmask(SIG_BLOCK, &nset, NULL);
signal(s, old_action);
if (reset_on_stop) {
reset_on_stop = 0;
@@ -636,8 +648,8 @@ newfileinfo()
/*ARGSUSED*/
int
-pversion(e)
- int e;
+pversion(v)
+ void *v;
{
extern char *version;