]> diplodocus.org Git - nmh/blobdiff - uip/whatnowsbr.c
Another pass at cleaning up (some of) the manpages.
[nmh] / uip / whatnowsbr.c
index 6e08d3eba0935871544ec2003c2c797d6825ade7..d8862dc9fc2250b1baf5f92ff545501a3a478b57 100644 (file)
@@ -321,7 +321,9 @@ WhatNow (int argc, char **argv)
                writesomecmd(buf, BUFSIZ, "cd", "pwd", argp);
            }
            if ((f = popen_in_dir(cwd, buf, "r")) != (FILE *)0) {
-               fgets(cwd, sizeof (cwd), f);
+               if (fgets(cwd, sizeof (cwd), f) == NULL) {
+                   advise (buf, "fgets");
+               }
 
                if (strchr(cwd, '\n') != (char *)0)
                        *strchr(cwd, '\n') = '\0';
@@ -444,9 +446,6 @@ WhatNow (int argc, char **argv)
                    annotate(drft, ATTACH_FIELD, file, 1, 0, -2, 1);
                    if (verbose) {
                        ctype = mime_type(file);
-                   }
-
-                   if (verbose) {
                        printf ("Attaching %s as a %s\n", file, ctype);
                        free (ctype);
                    }
@@ -691,7 +690,9 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp,
        if (atfile) {
            (void) m_unlink (linkpath);
            if (link (altpath, linkpath) == NOTOK) {
-               symlink (altpath, linkpath);
+               if (symlink (altpath, linkpath) < 0) {
+                   adios (linkpath, "symlink");
+               }
                slinked = 1;
            } else {
                slinked = 0;
@@ -709,8 +710,11 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp,
            break;
 
        case OK:
-           if (cwd)
-               chdir (cwd);
+           if (cwd) {
+               if (chdir (cwd) < 0) {
+                   advise (cwd, "chdir");
+               }
+           }
            if (altmsg) {
                if (mp)
                    m_putenv ("mhfolder", mp->foldpath);
@@ -949,6 +953,7 @@ buildfile (char **argp, char *file)
     X("tls", TLSminc(-3), TLSSW) \
     X("initialtls", TLSminc(-10), INITTLSSW) \
     X("notls", TLSminc(-5), NTLSSW) \
+    X("sendmail program", 0, MTSSM) \
     X("mts smtp|sendmail/smtp|sendmail/pipe", 2, MTSSW) \
     X("messageid localname|random", 2, MESSAGEIDSW) \
 
@@ -1138,6 +1143,7 @@ sendit (char *sp, char **arg, char *file, int pushed)
                case SASLMECHSW:
                case USERSW:
                case PORTSW:
+               case MTSSM:
                case MTSSW:
                case MESSAGEIDSW:
                    vec[vecp++] = --cp;
@@ -1249,10 +1255,10 @@ whomfile (char **arg, char *file)
 
        case OK:
            vec = argsplit(whomproc, &program, &vecp);
-           vec[vecp++] = file;
            if (arg)
                while (*arg)
                    vec[vecp++] = *arg++;
+           vec[vecp++] = file;
            vec[vecp] = NULL;
 
            execvp (program, vec);