SCCS-vsn: usr.bin/mail/names.c 5.8
SCCS-vsn: usr.bin/mail/send.c 5.10
-static char sccsid[] = "@(#)names.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)names.c 5.8 (Berkeley) %G%";
{
register char **ap, **top;
register struct name *n;
{
register char **ap, **top;
register struct name *n;
int t, extra, metoo, verbose;
n = np;
int t, extra, metoo, verbose;
n = np;
* Compute the number of extra arguments we will need.
* We need at least two extra -- one for "mail" and one for
* the terminating 0 pointer. Additional spots may be needed
* Compute the number of extra arguments we will need.
* We need at least two extra -- one for "mail" and one for
* the terminating 0 pointer. Additional spots may be needed
- * to pass along -r and -f to the host mailer.
+ * to pass along -f to the host mailer.
- if (rflag != NOSTR)
- extra += 2;
extra++;
metoo = value("metoo") != NOSTR;
if (metoo)
extra++;
metoo = value("metoo") != NOSTR;
if (metoo)
verbose = value("verbose") != NOSTR;
if (verbose)
extra++;
verbose = value("verbose") != NOSTR;
if (verbose)
extra++;
- if (hflag)
- extra += 2;
top = (char **) salloc((t + extra) * sizeof *top);
ap = top;
*ap++ = "send-mail";
top = (char **) salloc((t + extra) * sizeof *top);
ap = top;
*ap++ = "send-mail";
- if (rflag != NOSTR) {
- *ap++ = "-r";
- *ap++ = rflag;
- }
*ap++ = "-i";
if (metoo)
*ap++ = "-m";
if (verbose)
*ap++ = "-v";
*ap++ = "-i";
if (metoo)
*ap++ = "-m";
if (verbose)
*ap++ = "-v";
- if (hflag) {
- *ap++ = "-h";
- *ap++ = savestr(sprintf(hbuf, "%d", hflag));
- }
while (n != NIL) {
if (n->n_type & GDEL) {
n = n->n_flink;
while (n != NIL) {
if (n->n_type & GDEL) {
n = n->n_flink;
-/*
- * See if the user named himself as a destination
- * for outgoing mail. If so, set the global flag
- * selfsent so that we avoid removing his mailbox.
- */
-
-mechk(names)
- struct name *names;
-{
- register struct name *np;
-
- for (np = names; np != NIL; np = np->n_flink)
- if ((np->n_type & GDEL) == 0 && equal(np->n_name, myname)) {
- selfsent++;
- return;
- }
-}
-
/*
* Remove all of the duplicates from the passed name list by
* insertion sorting them, then checking for dups.
/*
* Remove all of the duplicates from the passed name list by
* insertion sorting them, then checking for dups.
-static char sccsid[] = "@(#)send.c 5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)send.c 5.10 (Berkeley) %G%";
#endif /* notdef */
#include "rcv.h"
#endif /* notdef */
#include "rcv.h"
struct name *to, *np;
struct stat sbuf;
FILE *mtf, *postage;
struct name *to, *np;
struct stat sbuf;
FILE *mtf, *postage;
- int remote = rflag != NOSTR || rmail;
to = outof(to, mtf, hp);
rewind(mtf);
to = outof(to, mtf, hp);
rewind(mtf);
- if (senderr && !remote) {
if (fsize(mtf) != 0) {
(void) remove(deadletter);
(void) exwrite(deadletter, mtf, 1);
if (fsize(mtf) != 0) {
(void) remove(deadletter);
(void) exwrite(deadletter, mtf, 1);
if (!gotcha)
goto out;
to = elide(to);
if (!gotcha)
goto out;
to = elide(to);
if (count(to) > 1)
hp->h_seq++;
if (count(to) > 1)
hp->h_seq++;
- if (hp->h_seq > 0 && !remote) {
fixhead(hp, to);
if (fsize(mtf) == 0)
if (hp->h_subject == NOSTR)
fixhead(hp, to);
if (fsize(mtf) == 0)
if (hp->h_subject == NOSTR)
}
if (pid == 0) {
#ifdef SIGTSTP
}
if (pid == 0) {
#ifdef SIGTSTP
- if (remote == 0) {
- (void) signal(SIGTSTP, SIG_IGN);
- (void) signal(SIGTTIN, SIG_IGN);
- (void) signal(SIGTTOU, SIG_IGN);
- }
+ (void) signal(SIGTSTP, SIG_IGN);
+ (void) signal(SIGTTIN, SIG_IGN);
+ (void) signal(SIGTTOU, SIG_IGN);
#endif
(void) signal(SIGHUP, SIG_IGN);
(void) signal(SIGINT, SIG_IGN);
#endif
(void) signal(SIGHUP, SIG_IGN);
(void) signal(SIGINT, SIG_IGN);
- if (remote || (value("verbose") != NOSTR)) {
+ if (value("verbose") != NOSTR) {
while ((p = wait(&s)) != pid && p != -1)
;
if (s.w_status != 0)
while ((p = wait(&s)) != pid && p != -1)
;
if (s.w_status != 0)
char buf[BUFSIZ];
register i;
time_t now, time();
char buf[BUFSIZ];
register i;
time_t now, time();
char *ctime();
if ((fo = fopen(name, "a")) == NULL) {
char *ctime();
if ((fo = fopen(name, "a")) == NULL) {
return (-1);
}
(void) time(&now);
return (-1);
}
(void) time(&now);
- if ((n = rflag) == NOSTR)
- n = myname;
- fprintf(fo, "From %s %s", n, ctime(&now));
+ fprintf(fo, "From %s %s", myname, ctime(&now));
rewind(fi);
while ((i = fread(buf, 1, sizeof buf, fi)) > 0)
(void) fwrite(buf, 1, i, fo);
rewind(fi);
while ((i = fread(buf, 1, sizeof buf, fi)) > 0)
(void) fwrite(buf, 1, i, fo);