Removed the draft message in favor for a consistent draft folder facility
[mmh] / uip / show.c
index eda19ca..413daeb 100644 (file)
@@ -35,13 +35,11 @@ static struct swit switches[] = {
        { "showmimeproc program", 0 },
 #define NSHOWSW  11
        { "noshowproc", 0 },
-#define DRFTSW  12
-       { "draft", 0 },
-#define FILESW  13
+#define FILESW  12
        { "file file", -4 },  /* interface from showfile */
-#define VERSIONSW  14
+#define VERSIONSW  13
        { "version", 0 },
-#define HELPSW  15
+#define HELPSW  14
        { "help", 0 },
        { NULL, 0 }
 };
@@ -62,9 +60,9 @@ int mhl (int, char **);
 int
 main (int argc, char **argv)
 {
-       int draftsw = 0, headersw = 1, msgp = 0;
+       int headersw = 1, msgp = 0;
        int nshow = 0, checkmime = 1, mime;
-       int vecp = 1, procp = 1, isdf = 0, mode = SHOW, msgnum;
+       int vecp = 1, procp = 1, mode = SHOW, msgnum;
        char *cp, *maildir, *file = NULL, *folder = NULL, *proc;
        char buf[BUFSIZ], **argp, **arguments;
        char *msgs[MAXARGS], *vec[MAXARGS];
@@ -107,20 +105,12 @@ main (int argc, char **argv)
                                        print_version(invo_name);
                                        done (1);
 
-                               case DRFTSW:
-                                       if (file)
-                                               adios (NULL, "only one file at a time!");
-                                       draftsw++;
-                                       if (mode == SHOW)
-                                               continue;
-usage:
-                                       adios (NULL,
-                                                       "usage: %s [+folder] [switches] [switches for showproc]",
-                                                       invo_name);
                                case FILESW:
                                        if (mode != SHOW)
-                                               goto usage;
-                                       if (draftsw || file)
+usage:
+                                               adios (NULL, "usage: %s [+folder] [switches] [switches for showproc]", invo_name);
+
+                                       if (file)
                                                adios (NULL, "only one file at a time!");
                                        if (!(cp = *argp++) || *cp == '-')
                                                adios (NULL, "missing argument to %s", argp[-2]);
@@ -189,18 +179,15 @@ usage:
        if (!context_find ("path"))
                free (path ("./", TFOLDER));
 
-       if (draftsw || file) {
+       if (file) {
                if (msgp)
                        adios (NULL, "only one file at a time!");
-               vec[vecp++] = draftsw
-                       ? getcpy (m_draft (folder, msgp ? msgs[0] : NULL, 1, &isdf))
-                       : file;
+               vec[vecp++] = file;
                goto go_to_it;
        }
 
 #ifdef WHATNOW
        if (!msgp && !folder && mode == SHOW && (cp = getenv ("mhdraft")) && *cp) {
-               draftsw++;
                vec[vecp++] = cp;
                goto go_to_it;
        }
@@ -281,7 +268,7 @@ go_to_it: ;
        } else {
                /* check if any messages are non-text MIME messages */
                if (checkmime && !getenv ("NOMHNPROC")) {
-                       if (!draftsw && !file) {
+                       if (!file) {
                                /* loop through selected messages and check for MIME */
                                for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)
                                        if (is_selected (mp, msgnum) && is_nontext (m_name (msgnum))) {
@@ -289,7 +276,7 @@ go_to_it: ;
                                                break;
                                        }
                        } else {
-                               /* check the file or draft for MIME */
+                               /* check the file for MIME */
                                if (is_nontext (vec[vecp - 1]))
                                        mime = 1;
                        }
@@ -302,16 +289,16 @@ go_to_it: ;
                        proc = showproc;
        }
 
-       if (folder && !draftsw && !file)
+       if (folder && !file)
                m_putenv ("mhfolder", folder);
 
        /*
         * For backward compatibility, if the "proc" is mhn,
         * then add "-show" option.  Add "-file" if showing
-        * file or draft.
+        * file.
         */
        if (strcmp (r1bindex (proc, '/'), "mhn") == 0) {
-               if (draftsw || file) {
+               if (file) {
                        vec[vecp] = vec[vecp - 1];
                        vec[vecp - 1] = "-file";
                        vecp++;
@@ -320,9 +307,9 @@ go_to_it: ;
                vec[vecp] = NULL;
        }
 
-       /* If the "proc" is "mhshow", add "-file" if showing file or draft.
+       /* If the "proc" is "mhshow", add "-file" if showing file.
         */
-       if (strcmp (r1bindex (proc, '/'), "mhshow") == 0 && (draftsw || file) ) {
+       if (strcmp (r1bindex (proc, '/'), "mhshow") == 0 && file ) {
           vec[vecp] = vec[vecp - 1];
           vec[vecp - 1] = "-file";
           vec[++vecp] = NULL;
@@ -344,7 +331,6 @@ go_to_it: ;
         * checking for mhn here, since we've already taken care of mhl.
         */
        if (!strcmp (r1bindex (proc, '/'), "mhl")
-                       && !draftsw
                        && !file
                        && chdir (maildir = concat (m_maildir (""), "/", NULL)) != NOTOK) {
                mp->foldpath = concat (mp->foldpath, "/", NULL);