On Mon, 24 Nov 2014 06:45:23 -0700, "Todd C. Miller" wrote:
> The -T flag just creates a temporary file for use with netnews that
> contains the article ids of messages that have been read or deleted.
> This is obsolete and should just be removed...
Updated diff that removes T from the getopt() string. We can also
remove a "bug" from the man page as all the options are now documented.
- todd
Index: usr.bin/mail/glob.h
===================================================================
--- usr.bin/mail/glob.h.orig
+++ usr.bin/mail/glob.h
@@ -40,7 +40,6 @@
int msgCount; /* Count of messages read in */
int rcvmode; /* True if receiving mail */
int sawcom; /* Set after first command */
-char *Tflag; /* -T temp file for netnews */
int senderr; /* An error while checking */
int edit; /* Indicates editing a file */
int readonly; /* Will be unable to rewrite file */
Index: usr.bin/mail/main.c
===================================================================
--- usr.bin/mail/main.c.orig
+++ usr.bin/mail/main.c
@@ -78,18 +78,8 @@ main(int argc, char **argv)
bcc = NULL;
smopts = NULL;
subject = NULL;
- while ((i = getopt(argc, argv, "EINT:b:c:dfins:u:v")) != -1) {
+ while ((i = getopt(argc, argv, "EIN:b:c:dfins:u:v")) != -1) {
switch (i) {
- case 'T':
- /*
- * Next argument is temp file to write which
- * articles have been read/deleted for netnews.
- */
- Tflag = optarg;
- if ((i = creat(Tflag, 0600)) < 0)
- err(1, "%s", Tflag);
- (void)close(i);
- break;
case 'u':
/*
* Next argument is person to pretend to be.
Index: usr.bin/mail/quit.c
===================================================================
--- usr.bin/mail/quit.c.orig
+++ usr.bin/mail/quit.c
@@ -64,7 +64,7 @@ int
quit(void)
{
int mcount, p, modify, autohold, anystat, holdbit, nohold;
- FILE *ibuf = NULL, *obuf, *fbuf, *rbuf, *readstat = NULL, *abuf;
+ FILE *ibuf = NULL, *obuf, *fbuf, *rbuf, *abuf;
struct message *mp;
int c, fd;
struct stat minfo;
@@ -154,10 +154,6 @@ quit(void)
mp->m_flag |= holdbit;
}
modify = 0;
- if (Tflag != NULL) {
- if ((readstat = Fopen(Tflag, "w")) == NULL)
- Tflag = NULL;
- }
for (c = 0, p = 0, mp = &message[0]; mp < &message[msgCount]; mp++) {
if (mp->m_flag & MBOX)
c++;
@@ -165,15 +161,7 @@ quit(void)
p++;
if (mp->m_flag & MODIFY)
modify++;
- if (Tflag != NULL && (mp->m_flag & (MREAD|MDELETED)) != 0) {
- char *id;
-
- if ((id = hfield("article-id", mp)) != NULL)
- fprintf(readstat, "%s\n", id);
- }
}
- if (Tflag != NULL)
- (void)Fclose(readstat);
if (p == msgCount && !modify && !anystat) {
printf("Held %d message%s in %s\n",
p, p == 1 ? "" : "s", mailname);
@@ -399,17 +387,13 @@ edstop(void)
{
int gotcha, c;
struct message *mp;
- FILE *obuf, *ibuf, *readstat = NULL;
+ FILE *obuf, *ibuf;
struct stat statb;
char tempname[PATHSIZE];
if (readonly)
return(0);
holdsigs();
- if (Tflag != NULL) {
- if ((readstat = Fopen(Tflag, "w")) == NULL)
- Tflag = NULL;
- }
for (mp = &message[0], gotcha = 0; mp < &message[msgCount]; mp++) {
if (mp->m_flag & MNEW) {
mp->m_flag &= ~MNEW;
@@ -417,16 +401,8 @@ edstop(void)
}
if (mp->m_flag & (MODIFY|MDELETED|MSTATUS))
gotcha++;
- if (Tflag != NULL && (mp->m_flag & (MREAD|MDELETED)) != 0) {
- char *id;
-
- if ((id = hfield("article-id", mp)) != NULL)
- fprintf(readstat, "%s\n", id);
- }
}
- if (Tflag != NULL)
- (void)Fclose(readstat);
- if (!gotcha || Tflag != NULL)
+ if (!gotcha)
goto done;
ibuf = NULL;
if (stat(mailname, &statb) >= 0 && statb.st_size > mailsize) {
Index: usr.bin/mail/mail.1
===================================================================
--- usr.bin/mail/mail.1.orig
+++ usr.bin/mail/mail.1
@@ -1202,10 +1202,6 @@ This man page is derived from the
.%T "Mail Reference Manual"
originally written by Kurt Shoens.
.Sh BUGS
-There are some flags that are not documented here.
-Most are
-not useful to the general user.
-.Pp
Usually,
.Nm mail
and