version 1.24, 2014/11/24 20:01:43 |
version 1.25, 2014/11/24 20:03:33 |
|
|
/* |
/* |
* User is specifying file to "edit" with Mail, |
* User is specifying file to "edit" with Mail, |
* as opposed to reading system mailbox. |
* as opposed to reading system mailbox. |
* If no argument is given after -f, we read his |
* We read his mbox file unless another file |
* mbox file. |
* is specified after the arguments. |
* |
|
* getopt() can't handle optional arguments, so here |
|
* is an ugly hack to get around it. |
|
*/ |
*/ |
if ((argv[optind]) && (argv[optind][0] != '-')) |
ef = "&"; |
ef = argv[optind++]; |
|
else |
|
ef = "&"; |
|
break; |
break; |
case 'n': |
case 'n': |
/* |
/* |
|
|
/*NOTREACHED*/ |
/*NOTREACHED*/ |
} |
} |
} |
} |
for (i = optind; (argv[i]) && (*argv[i] != '-'); i++) |
if (ef != NULL) { |
to = cat(to, nalloc(argv[i], GTO)); |
/* Check for optional mailbox file name. */ |
for (; argv[i]; i++) |
if (optind < argc) { |
smopts = cat(smopts, nalloc(argv[i], 0)); |
ef = argv[optind++]; |
|
if (optind < argc) |
|
errx(1, "Cannot give -f and people to send to"); |
|
} |
|
} else { |
|
for (i = optind; (argv[i]) && (*argv[i] != '-'); i++) |
|
to = cat(to, nalloc(argv[i], GTO)); |
|
for (; argv[i]; i++) |
|
smopts = cat(smopts, nalloc(argv[i], 0)); |
|
} |
/* |
/* |
* Check for inconsistent arguments. |
* Check for inconsistent arguments. |
*/ |
*/ |
if (to == NULL && (subject != NULL || cc != NULL || bcc != NULL)) |
if (to == NULL && (subject != NULL || cc != NULL || bcc != NULL)) |
errx(1, "You must specify direct recipients with -s, -c, or -b"); |
errx(1, "You must specify direct recipients with -s, -c, or -b"); |
if (ef != NULL && to != NULL) |
|
errx(1, "Cannot give -f and people to send to"); |
|
/* |
/* |
* Block SIGINT except where we install an explicit handler for it. |
* Block SIGINT except where we install an explicit handler for it. |
*/ |
*/ |