- if (is_selected (mp, msgnum))
- unset_exists (mp, msgnum);
- }
-
- /* Mark that the sequence information has changed */
- mp->msgflags |= SEQMOD;
-
- if (mp->numsel > MAXARGS - 2)
- adios (NULL, "more than %d messages for %s exec", MAXARGS - 2,
- rmmproc);
- vec = (char **) calloc ((size_t) (mp->numsel + 2), sizeof(*vec));
- if (vec == NULL)
- adios (NULL, "unable to allocate exec vector");
- vecp = 1;
- for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
- if (is_selected (mp, msgnum) &&
- !(vec[vecp++] = strdup (m_name (msgnum))))
- adios (NULL, "strdup failed");
- }
- vec[vecp] = NULL;
-
- fflush (stdout);
- vec[0] = r1bindex (rmmproc, '/');
-
- switch (pid = vfork()) {
- case -1:
- advise ("fork", "unable to");
- return -1;
-
- case 0:
- execvp (rmmproc, vec);
- fprintf (stderr, "unable to exec ");
- perror (rmmproc);
- _exit (-1);