case OK:
vecp = 0;
vec[vecp++] = mhbasename(*ed);
- if (arg)
- while (*arg)
- vec[vecp++] = *arg++;
+ while (arg && *arg) {
+ vec[vecp++] = *arg++;
+ }
vec[vecp++] = file;
vec[vecp] = NULL;
static int
refile(char **arg, char *file)
{
- pid_t pid;
- register int vecp;
+ int vecp = 0;
char *vec[MAXARGS];
- vecp = 0;
vec[vecp++] = "refile";
vec[vecp++] = "-nolink"; /* override bad .mh_profile defaults */
vec[vecp++] = "-file";
}
vec[vecp] = NULL;
- context_save(); /* save the context file */
+ context_save();
fflush(stdout);
- switch (pid = fork()) {
- case -1:
- advise("fork", "unable to");
- return -1;
-
- case 0:
- execvp(*vec, vec);
- fprintf(stderr, "%s: unable to exec ", invo_name);
- perror(*vec);
- _exit(-1);
-
- default:
- return (pidwait(pid, -1));
- }
+ return execprog(*vec, vec);
}