- if (access (filter, R_OK) == NOTOK)
- adios (filter, "unable to read");
-
- mhl = r1bindex (mhlproc, '/');
-
- rewind (in);
- lseek (fileno(in), (off_t) 0, SEEK_SET);
-
- switch (pid = vfork ()) {
- case NOTOK:
- adios ("fork", "unable to");
-
- case OK:
- dup2 (fileno (in), fileno (stdin));
- dup2 (fileno (out), fileno (stdout));
- closefds (3);
-
- execlp (mhlproc, mhl, "-form", filter, "-noclear", NULL);
- errstr = strerror(errno);
- write(2, "unable to exec ", 15);
- write(2, mhlproc, strlen(mhlproc));
- write(2, ": ", 2);
- write(2, errstr, strlen(errstr));
- write(2, "\n", 1);
- _exit (-1);
-
- default:
- if (pidXwait (pid, mhl))
- done (1);
- fseek (out, 0L, SEEK_END);
- break;
+ if (access(filter, R_OK) == NOTOK)
+ adios(filter, "unable to read");
+
+ mhl = mhbasename(mhlproc);
+
+ rewind(in);
+ lseek(fileno(in), (off_t) 0, SEEK_SET);
+
+ switch (pid = fork()) {
+ case NOTOK:
+ adios("fork", "unable to");
+
+ case OK:
+ dup2(fileno(in), fileno(stdin));
+ dup2(fileno(out), fileno(stdout));
+ closefds(3);
+
+ execlp(mhlproc, mhl, "-form", filter, "-noclear", NULL);
+ errstr = strerror(errno);
+ write(2, "unable to exec ", 15);
+ write(2, mhlproc, strlen(mhlproc));
+ write(2, ": ", 2);
+ write(2, errstr, strlen(errstr));
+ write(2, "\n", 1);
+ _exit(-1);
+
+ default:
+ if (pidXwait(pid, mhl))
+ done(1);
+ fseek(out, 0L, SEEK_END);
+ break;