SCCS-vsn: usr.bin/mail/cmd3.c 1.8
* Still more user commands.
*/
* Still more user commands.
*/
-static char *SccsId = "@(#)cmd3.c 1.7 %G%";
+static char *SccsId = "@(#)cmd3.c 1.8 %G%";
/*
* Process a shell escape by saving signals, ignoring signals,
/*
* Process a shell escape by saving signals, ignoring signals,
}
mp = &message[msgvec[0] - 1];
dot = mp;
}
mp = &message[msgvec[0] - 1];
dot = mp;
strcpy(buf, "");
cp = hfield("to", mp);
if (cp != NOSTR)
strcpy(buf, "");
cp = hfield("to", mp);
if (cp != NOSTR)
head.h_subject = hfield("subject", mp);
if (head.h_subject == NOSTR)
head.h_subject = hfield("subj", mp);
head.h_subject = hfield("subject", mp);
if (head.h_subject == NOSTR)
head.h_subject = hfield("subj", mp);
+ head.h_subject = reedit(head.h_subject);
head.h_cc = NOSTR;
cp = hfield("cc", mp);
if (cp != NOSTR) {
head.h_cc = NOSTR;
cp = hfield("cc", mp);
if (cp != NOSTR) {
+/*
+ * Modify the subject we are replying to to begin with Re: if
+ * it does not already.
+ */
+
+char *
+reedit(subj)
+ char *subj;
+{
+ char sbuf[10];
+ register char *newsubj;
+
+ if (subj == NOSTR)
+ return(NOSTR);
+ strncpy(sbuf, subj, 3);
+ sbuf[3] = 0;
+ if (icequal(sbuf, "re:"))
+ return(subj);
+ newsubj = salloc(strlen(subj) + 6);
+ sprintf(newsubj, "Re: %s", subj);
+ return(newsubj);
+}
+
/*
* Preserve the named messages, so that they will be sent
* back to the system mailbox.
/*
* Preserve the named messages, so that they will be sent
* back to the system mailbox.
for (s = 0, ap = msgvec; *ap != 0; ap++) {
mp = &message[*ap - 1];
dot = mp;
for (s = 0, ap = msgvec; *ap != 0; ap++) {
mp = &message[*ap - 1];
dot = mp;
- s += strlen(nameof(mp)) + 1;
+ s += strlen(nameof(mp, 1)) + 1;
head.h_to = cp;
for (ap = msgvec; *ap != 0; ap++) {
mp = &message[*ap - 1];
head.h_to = cp;
for (ap = msgvec; *ap != 0; ap++) {
mp = &message[*ap - 1];
- cp = copy(nameof(mp), cp);
+ cp = copy(nameof(mp, 1), cp);
*cp++ = ' ';
}
*--cp = 0;
*cp++ = ' ';
}
*--cp = 0;
head.h_seq = 0;
if (subject == NOSTR)
subject = hfield("subj", mp);
head.h_seq = 0;
if (subject == NOSTR)
subject = hfield("subj", mp);
- head.h_subject = subject;
+ head.h_subject = reedit(subject);
if (subject != NOSTR)
head.h_seq++;
head.h_cc = NOSTR;
if (subject != NOSTR)
head.h_seq++;
head.h_cc = NOSTR;