=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mail/main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/mail/main.c 1997/01/15 23:42:50 1.4 --- src/usr.bin/mail/main.c 1997/07/13 21:21:15 1.5 *************** *** 1,5 **** ! /* $OpenBSD: main.c,v 1.4 1997/01/15 23:42:50 millert Exp $ */ ! /* $NetBSD: main.c,v 1.5 1996/06/08 19:48:31 christos Exp $ */ /* * Copyright (c) 1980, 1993 --- 1,5 ---- ! /* $OpenBSD: main.c,v 1.5 1997/07/13 21:21:15 millert Exp $ */ ! /* $NetBSD: main.c,v 1.7 1997/05/13 06:15:57 mikel Exp $ */ /* * Copyright (c) 1980, 1993 *************** *** 42,50 **** #ifndef lint #if 0 ! static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: main.c,v 1.4 1997/01/15 23:42:50 millert Exp $"; #endif #endif /* not lint */ --- 42,50 ---- #ifndef lint #if 0 ! static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/20/95"; #else ! static char rcsid[] = "$OpenBSD: main.c,v 1.5 1997/07/13 21:21:15 millert Exp $"; #endif #endif /* not lint */ *************** *** 72,77 **** --- 72,78 ---- char *ef; char nosrc = 0; sig_t prevint; + char *rc; /* * Set up a reasonable environment. *************** *** 103,113 **** * articles have been read/deleted for netnews. */ Tflag = optarg; ! if ((i = creat(Tflag, 0600)) < 0) { ! perror(Tflag); ! exit(1); ! } ! close(i); break; case 'u': /* --- 104,112 ---- * articles have been read/deleted for netnews. */ Tflag = optarg; ! if ((i = creat(Tflag, 0600)) < 0) ! err(1, Tflag); ! (void)close(i); break; case 'u': /* *************** *** 185,196 **** bcc = cat(bcc, nalloc(optarg, GBCC)); break; case '?': ! fputs("\ ! Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\ [- sendmail-options ...]\n\ ! mail [-iInNv] -f [name]\n\ ! mail [-iInNv] [-u user]\n", ! stderr); exit(1); } } --- 184,194 ---- bcc = cat(bcc, nalloc(optarg, GBCC)); break; case '?': ! fprintf(stderr, "\ ! Usage: %s [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...\n\ [- sendmail-options ...]\n\ ! %s [-iInNv] -f [name]\n\ ! %s [-iInNv] [-u user]\n", __progname, __progname, __progname); exit(1); } } *************** *** 201,214 **** /* * Check for inconsistent arguments. */ ! if (to == NIL && (subject != NOSTR || cc != NIL || bcc != NIL)) { ! fputs("You must specify direct recipients with -s, -c, or -b.\n", stderr); ! exit(1); ! } ! if (ef != NOSTR && to != NIL) { ! fprintf(stderr, "Cannot give -f and people to send to.\n"); ! exit(1); ! } tinit(); setscreensize(); input = stdin; --- 199,208 ---- /* * Check for inconsistent arguments. */ ! if (to == NIL && (subject != NOSTR || cc != NIL || bcc != NIL)) ! errx(1, "You must specify direct recipients with -s, -c, or -b"); ! if (ef != NOSTR && to != NIL) ! errx(1, "Cannot give -f and people to send to"); tinit(); setscreensize(); input = stdin; *************** *** 220,226 **** * Expand returns a savestr, but load only uses the file name * for fopen, so it's safe to do this. */ ! load(expand("~/.mailrc")); if (!rcvmode) { mail(to, cc, bcc, smopts, subject); /* --- 214,222 ---- * Expand returns a savestr, but load only uses the file name * for fopen, so it's safe to do this. */ ! if ((rc = getenv("MAILRC")) == 0) ! rc = "~/.mailrc"; ! load(expand(rc)); if (!rcvmode) { mail(to, cc, bcc, smopts, subject); /* *************** *** 266,272 **** { fflush(stdout); ! fprintf(stderr, "\nInterrupt\n"); longjmp(hdrjmp, 1); } --- 262,268 ---- { fflush(stdout); ! fputs("\nInterrupt\n", stderr); longjmp(hdrjmp, 1); }