{ "send [<switches>]", 0 },
#define PUSHSW 6
{ "push [<switches>]", 0 },
-#define WHOMSW 7
- { "whom [<switches>]", 0 },
#define QUITSW 8
{ "quit [-delete]", 0 },
#define DELETESW 9
static void sendit (char *, char **, char *, int);
static int buildfile (char **, char *);
static int check_draft (char *);
-static int whomfile (char **, char *);
static int removefile (char *);
static void writelscmd(char *, int, char **);
static void writesomecmd(char *buf, int bufsz, char *cmd, char *trailcmd, char **argp);
showfile (++argp, drft);
break;
- case WHOMSW:
- /* Check to whom the draft would be sent */
- whomfile (++argp, drft);
- break;
-
case QUITSW:
/* Quit, and possibly delete the draft */
if (*++argp && (*argp[0] == 'd' ||
done (0);
}
-/*
- * WHOM
- */
-
-static int
-whomfile (char **arg, char *file)
-{
- pid_t pid;
- int vecp;
- char *vec[MAXARGS];
-
- context_save (); /* save the context file */
- fflush (stdout);
-
- switch (pid = vfork ()) {
- case NOTOK:
- advise ("fork", "unable to");
- return 1;
-
- case OK:
- vecp = 0;
- vec[vecp++] = r1bindex (whomproc, '/');
- vec[vecp++] = file;
- if (arg)
- while (*arg)
- vec[vecp++] = *arg++;
- vec[vecp] = NULL;
-
- execvp (whomproc, vec);
- fprintf (stderr, "unable to exec ");
- perror (whomproc);
- _exit (-1); /* NOTREACHED */
-
- default:
- return (pidwait (pid, NOTOK) & 0377 ? 1 : 0);
- }
-}
-
/*
* Remove the draft file