version 1.3, 1997/01/15 23:42:29 |
version 1.4, 1998/07/10 15:51:20 |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <unistd.h> |
#include <paths.h> |
#include <paths.h> |
|
#include <err.h> |
|
|
main(argc, argv) |
main(argc, argv) |
int argc; |
int argc; |
|
|
if (!file) { |
if (!file) { |
if (!(file = *argv)) { |
if (!(file = *argv)) { |
if (!(file = getenv("MAIL"))) { |
if (!(file = getenv("MAIL"))) { |
if (!(pwd = getpwuid(getuid()))) { |
if (!(pwd = getpwuid(getuid()))) |
(void)fprintf(stderr, |
errx(1, "no password file entry for you"); |
"from: no password file entry for you.\n"); |
|
exit(1); |
|
} |
|
if (file = getenv("USER")) { |
if (file = getenv("USER")) { |
(void)sprintf(buf, "%s/%s", |
(void)sprintf(buf, "%s/%s", |
_PATH_MAILDIR, file); |
_PATH_MAILDIR, file); |
|
|
file = buf; |
file = buf; |
} |
} |
} |
} |
if (!freopen(file, "r", stdin)) { |
if (!freopen(file, "r", stdin)) |
(void)fprintf(stderr, "from: can't read %s.\n", file); |
errx(1, file); |
exit(1); |
|
} |
|
for (newline = 1; fgets(buf, sizeof(buf), stdin);) { |
for (newline = 1; fgets(buf, sizeof(buf), stdin);) { |
if (*buf == '\n') { |
if (*buf == '\n') { |
newline = 1; |
newline = 1; |