From: Ken Hornstein Date: Sat, 7 Mar 2015 03:58:58 +0000 (-0500) Subject: Rearrange all callers of post(8) so that the filename is always last. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/4857e59b250f28a2d020bccac8bbcb489b48e328?ds=inline Rearrange all callers of post(8) so that the filename is always last. --- diff --git a/uip/mhmail b/uip/mhmail index b5a3c35e..c43f9c3f 100755 --- a/uip/mhmail +++ b/uip/mhmail @@ -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=$? diff --git a/uip/rcvdist.c b/uip/rcvdist.c index 6d144be1..ae55f613 100644 --- a/uip/rcvdist.c +++ b/uip/rcvdist.c @@ -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++) diff --git a/uip/sendsbr.c b/uip/sendsbr.c index af9412df..07c7f974 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -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; diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 21fb1519..207f1a8c 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -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);