summaryrefslogtreecommitdiff
path: root/usr.bin/from
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/from')
-rw-r--r--usr.bin/from/from.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c
index b914edfcd8f..b05b3500adf 100644
--- a/usr.bin/from/from.c
+++ b/usr.bin/from/from.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: from.c,v 1.6 2000/01/18 04:57:55 millert Exp $ */
+/* $OpenBSD: from.c,v 1.7 2001/07/12 05:17:06 deraadt Exp $ */
/* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)from.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: from.c,v 1.6 2000/01/18 04:57:55 millert Exp $";
+static char rcsid[] = "$OpenBSD: from.c,v 1.7 2001/07/12 05:17:06 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -54,8 +54,12 @@ static char rcsid[] = "$OpenBSD: from.c,v 1.6 2000/01/18 04:57:55 millert Exp $"
#include <stdlib.h>
#include <unistd.h>
#include <paths.h>
+#include <string.h>
#include <err.h>
+int match(char *, char *);
+
+int
main(argc, argv)
int argc;
char **argv;
@@ -102,7 +106,7 @@ main(argc, argv)
if (!(file = getenv("MAIL"))) {
if (!(pwd = getpwuid(getuid())))
errx(1, "no password file entry for you");
- if (file = getenv("USER")) {
+ if ((file = getenv("USER"))) {
(void)snprintf(buf, sizeof(buf),
"%s/%s", _PATH_MAILDIR, file);
file = buf;
@@ -132,8 +136,9 @@ main(argc, argv)
exit(0);
}
+int
match(line, sender)
- register char *line, *sender;
+ char *line, *sender;
{
register char ch, pch, first, *p, *t;