diff options
author | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
---|---|---|
committer | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
commit | e5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch) | |
tree | d8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/cmd/upas/misc/unix/mail.c |
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/cmd/upas/misc/unix/mail.c')
-rwxr-xr-x | sys/src/cmd/upas/misc/unix/mail.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/sys/src/cmd/upas/misc/unix/mail.c b/sys/src/cmd/upas/misc/unix/mail.c new file mode 100755 index 000000000..20cf23970 --- /dev/null +++ b/sys/src/cmd/upas/misc/unix/mail.c @@ -0,0 +1,51 @@ +/* + * #!/bin/sh + * case $1 in + * -n) + * exit 0 ;; + * -m*|-f*|-r*|-p*|-e*|"") + * exec /usr/lib/upas/edmail $* + * exit $? ;; + * *) + * exec /usr/lib/upas/send $* + * exit $? ;; + * esac + */ + + +extern *UPASROOT; + +#define EDMAIL "edmail" +#define SEND "send" + +main (argc, argv) + int argc; + char **argv; +{ + char *progname = SEND; + char realprog[500]; + + if (argc > 1) { + if (argv[1][0] == '-') { + switch (argv[1][1]) { + case 'n': + exit (0); + + case 'm': + case 'f': + case 'r': + case 'p': + case 'e': + case '\0': + progname = EDMAIL; + } + } + } else + progname = EDMAIL; + + sprint(realprog, "%s/%s", UPASROOT, progname); + execv (realprog, argv); + perror (realprog); + exit (1); +} + |