=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/from/from.c,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** src/usr.bin/from/from.c 1997/01/15 23:42:29 1.3 --- src/usr.bin/from/from.c 1998/07/10 15:51:20 1.4 *************** *** 1,4 **** ! /* $OpenBSD: from.c,v 1.3 1997/01/15 23:42:29 millert Exp $ */ /* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: from.c,v 1.4 1998/07/10 15:51:20 mickey Exp $ */ /* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */ /* *************** *** 44,50 **** #if 0 static char sccsid[] = "@(#)from.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: from.c,v 1.3 1997/01/15 23:42:29 millert Exp $"; #endif /* not lint */ #include --- 44,50 ---- #if 0 static char sccsid[] = "@(#)from.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: from.c,v 1.4 1998/07/10 15:51:20 mickey Exp $"; #endif /* not lint */ #include *************** *** 54,59 **** --- 54,60 ---- #include #include #include + #include main(argc, argv) int argc; *************** *** 99,109 **** if (!file) { if (!(file = *argv)) { if (!(file = getenv("MAIL"))) { ! if (!(pwd = getpwuid(getuid()))) { ! (void)fprintf(stderr, ! "from: no password file entry for you.\n"); ! exit(1); ! } if (file = getenv("USER")) { (void)sprintf(buf, "%s/%s", _PATH_MAILDIR, file); --- 100,107 ---- if (!file) { if (!(file = *argv)) { if (!(file = getenv("MAIL"))) { ! if (!(pwd = getpwuid(getuid()))) ! errx(1, "no password file entry for you"); if (file = getenv("USER")) { (void)sprintf(buf, "%s/%s", _PATH_MAILDIR, file); *************** *** 117,126 **** file = buf; } } ! if (!freopen(file, "r", stdin)) { ! (void)fprintf(stderr, "from: can't read %s.\n", file); ! exit(1); ! } for (newline = 1; fgets(buf, sizeof(buf), stdin);) { if (*buf == '\n') { newline = 1; --- 115,122 ---- file = buf; } } ! if (!freopen(file, "r", stdin)) ! errx(1, file); for (newline = 1; fgets(buf, sizeof(buf), stdin);) { if (*buf == '\n') { newline = 1;