]> diplodocus.org Git - nmh/commitdiff
Rearrange all callers of post(8) so that the filename is always last.
authorKen Hornstein <kenh@pobox.com>
Sat, 7 Mar 2015 03:58:58 +0000 (22:58 -0500)
committerKen Hornstein <kenh@pobox.com>
Sat, 7 Mar 2015 03:58:58 +0000 (22:58 -0500)
uip/mhmail
uip/rcvdist.c
uip/sendsbr.c
uip/whatnowsbr.c

index b5a3c35..c43f9c3 100755 (executable)
@@ -292,7 +292,7 @@ else
     post_or_send="$nmhbindir/send"
   fi
 
-  if "$post_or_send" "$tmpfile" $postsendargs; then
+  if "$post_or_send" $postsendargs "$tmpfile"; then
     exit
   else
     status=$?
index 6d144be..ae55f61 100644 (file)
@@ -118,11 +118,11 @@ main (int argc, char **argv)
        done (1);
 
     vec[vecp++] = "-dist";
-    vec[vecp++] = drft;
     if ((cp = context_find ("mhlproc"))) {
       vec[vecp++] = "-mhlproc";
       vec[vecp++] = cp;
     }
+    vec[vecp++] = drft;
     vec[vecp] = NULL;
 
     for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
index af9412d..07c7f97 100644 (file)
@@ -389,7 +389,6 @@ sendaux (char **vec, int vecp, char *program, char *drft, struct stat *st)
     fd = pushsw ? tmp_fd () : NOTOK;
     fd2 = NOTOK;
 
-    vec[vecp++] = drft;
     if (annotext) {
        if ((fd2 = tmp_fd ()) != NOTOK) {
            vec[vecp++] = "-idanno";
@@ -400,6 +399,7 @@ sendaux (char **vec, int vecp, char *program, char *drft, struct stat *st)
                       "for annotation list", get_temp_dir());
        }
     }
+    vec[vecp++] = drft;
     if (distfile && distout (drft, distfile, backup) == NOTOK)
        done (1);
     vec[vecp] = NULL;
index 21fb151..207f1a8 100644 (file)
@@ -1253,10 +1253,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);