]> diplodocus.org Git - nmh/blobdiff - uip/whatnowsbr.c
uip/mhshowsbr.c: Increase buffer size for showing-content command.
[nmh] / uip / whatnowsbr.c
index e2e0ceb64546ab41a72bc3b63253d0aee05d5f73..164a552a855ca64b63827e6caac741d7344ead3b 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * whatnowsbr.c -- the WhatNow shell
+/* whatnowsbr.c -- the WhatNow shell
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
 #include <fcntl.h>
 #include <h/mime.h>
 #include <h/utils.h>
-
 #ifdef OAUTH_SUPPORT
 # include <h/oauth.h>
 #endif
+#include "../sbr/m_maildir.h"
+#include "../sbr/m_mktemp.h"
+#include "../sbr/mime_type.h"
 
 #define WHATNOW_SWITCHES \
     X("draftfolder +folder", 0, DFOLDSW) \
@@ -57,8 +57,6 @@
     X("prompt string", 4, PRMPTSW) \
     X("version", 0, VERSIONSW) \
     X("help", 0, HELPSW) \
-    X("attach header-field-name", -6, ATTACHSW) \
-    X("noattach", -8, NOATTACHSW) \
 
 
 #define X(sw, minchars, id) id,
@@ -197,14 +195,6 @@ WhatNow (int argc, char **argv)
                if (!(myprompt = *argp++) || *myprompt == '-')
                    adios (NULL, "missing argument to %s", argp[-2]);
                continue;
-
-           case ATTACHSW:
-               inform("The -attach switch is deprecated");
-               continue;
-
-           case NOATTACHSW:
-               inform("The -noattach switch is deprecated");
-               continue;
            }
        }
        if (drft)
@@ -718,8 +708,8 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp,
            }
            if (altmsg) {
                if (mp)
-                   m_putenv ("mhfolder", mp->foldpath);
-               m_putenv ("editalt", altpath);
+                   setenv("mhfolder", mp->foldpath, 1);
+               setenv("editalt", altpath, 1);
            }
 
            vec = argsplit(*ed, &prog, &vecp);
@@ -948,9 +938,6 @@ buildfile (char **argp, char *file)
     X("saslmech", SASLminc(5), SASLMECHSW) \
     X("authservice", SASLminc(0), AUTHSERVICESW) \
     X("user username", SASLminc(4), USERSW) \
-    X("attach fieldname", 6, SNDATTACHSW) \
-    X("noattach", 0, SNDNOATTACHSW) \
-    X("attachformat", 7, SNDATTACHFORMAT) \
     X("port server-port-name/number", 4, PORTSW) \
     X("tls", TLSminc(-3), TLSSW) \
     X("initialtls", TLSminc(-10), INITTLSSW) \
@@ -1190,17 +1177,6 @@ sendit (char *sp, char **arg, char *file, int pushed)
                    /* FALLTHRU */
                case SNDRFSW:
                    continue;
-
-               case SNDATTACHSW:
-                   inform("The -attach switch is deprecated");
-                   continue;
-               case SNDNOATTACHSW:
-                   inform("The -noattach switch is deprecated");
-                   continue;
-
-               case SNDATTACHFORMAT:
-                   inform("The -attachformat switch is deprecated");
-                   continue;
            }
        }
        inform("usage: %s [switches]", sp);
@@ -1220,7 +1196,7 @@ sendit (char *sp, char **arg, char *file, int pushed)
 
     if ((cp = getenv ("SIGNATURE")) == NULL || *cp == 0)
        if ((cp = context_find ("signature")) && *cp)
-           m_putenv ("SIGNATURE", cp);
+           setenv("SIGNATURE", cp, 1);
 
     if ((annotext = getenv ("mhannotate")) == NULL || *annotext == 0)
        annotext = NULL;
@@ -1337,7 +1313,7 @@ checkmimeheader (char *drft)
 {
     FILE *f;
     m_getfld_state_t gstate = 0;
-    char buf[BUFSIZ], name[NAMESZ];
+    char buf[NMH_BUFSIZ], name[NAMESZ];
     int state, retval = 0;
 
     if ((f = fopen(drft, "r")) == NULL) {