]> diplodocus.org Git - nmh/blobdiff - uip/whatnowsbr.c
Add comment describing concat().
[nmh] / uip / whatnowsbr.c
index 80386e95331883d053fc224c77934c3dbc53d2f8..088ca242a7b16fce99ba83f350d7cdb0251933cb 100644 (file)
@@ -216,7 +216,7 @@ WhatNow (int argc, char **argv)
     if ((drft == NULL && (drft = getenv ("mhdraft")) == NULL) || *drft == 0)
        drft = getcpy (m_draft (dfolder, dmsg, 1, &isdf));
 
-    msgnam = (cp = getenv ("mhaltmsg")) && *cp ? getcpy (cp) : NULL;
+    msgnam = (cp = getenv ("mhaltmsg")) && *cp ? mh_xstrdup(cp) : NULL;
 
     if ((cp = getenv ("mhatfile")) && *cp)
        atfile = atoi(cp);
@@ -328,10 +328,7 @@ WhatNow (int argc, char **argv)
                if (fgets(cwd, sizeof (cwd), f) == NULL) {
                    advise (buf, "fgets");
                }
-
-               if (strchr(cwd, '\n') != (char *)0)
-                       *strchr(cwd, '\n') = '\0';
-
+                TrimSuffixC(cwd, '\n');
                pclose(f);
            }
            else {
@@ -438,7 +435,7 @@ WhatNow (int argc, char **argv)
                while (fgets(shell, sizeof (shell), f) != (char *)0) {
                    char *ctype;
 
-                   *(strchr(shell, '\n')) = '\0';
+                    TrimSuffixC(shell, '\n');
 
                    if (*shell == '/') {
                        strncpy(file, shell, sizeof(file));
@@ -523,7 +520,7 @@ WhatNow (int argc, char **argv)
            writelscmd(buf, sizeof(buf), "-d --", argp);
            if ((f = popen_in_dir(cwd, buf, "r")) != (FILE *)0) {
                while (fgets(shell, sizeof (shell), f) != (char *)0) {
-                   *(strchr(shell, '\n')) = '\0';
+                    TrimSuffixC(shell, '\n');
                    annotate(drft, ATTACH_FIELD, shell, 1, 0, 0, 1);
                }
                pclose(f);
@@ -947,7 +944,6 @@ buildfile (char **argp, char *file)
     X("nodraftfolder", 0, SNDRFSW) \
     X("sasl", SASLminc(4), SASLSW) \
     X("nosasl", SASLminc(6), NOSASLSW) \
-    X("saslmaxssf", SASLminc(10), SASLMXSSFSW) \
     X("saslmech", SASLminc(5), SASLMECHSW) \
     X("authservice", SASLminc(0), AUTHSERVICESW) \
     X("user username", SASLminc(4), USERSW) \
@@ -1165,7 +1161,6 @@ sendit (char *sp, char **arg, char *file, int pushed)
                case WIDTHSW:
                case CLIESW:
                case SERVSW:
-               case SASLMXSSFSW:
                case USERSW:
                case PORTSW:
                case MTSSM:
@@ -1209,7 +1204,7 @@ sendit (char *sp, char **arg, char *file, int pushed)
     if ((cp = context_find ("Aliasfile"))) {
        char **ap, *dp;
 
-       dp = getcpy (cp);
+       dp = mh_xstrdup(cp);
        for (ap = brkstring (dp, " ", "\n"); ap && *ap; ap++) {
            vec[vecp++] = "-alias";
            vec[vecp++] = *ap;
@@ -1238,7 +1233,7 @@ sendit (char *sp, char **arg, char *file, int pushed)
            adios(NULL, "unable to create temporary file in %s",
                  get_temp_dir());
        }
-       distfile = getcpy (cp);
+       distfile = mh_xstrdup(cp);
        (void) m_unlink(distfile);
        if (link (altmsg, distfile) == NOTOK)
            adios (distfile, "unable to link %s to", altmsg);