X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/f52aa1ce52a53ead867f840f18c834871925de6c..2f3e60ab51648c4e0cf0e686600428cd5f56aa66:/uip/sendsbr.c diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 06358fd3..2350ccf4 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -908,8 +908,10 @@ static void alert (char *file, int out) { pid_t child_id; - int i, in; + int i, in, argp; char buf[BUFSIZ]; + char *program; + char **arglist; for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++) sleep (5); @@ -949,8 +951,14 @@ alert (char *file, int out) snprintf (buf, sizeof(buf), "send failed on %s", forwsw ? "enclosed draft" : file); - execlp (mailproc, r1bindex (mailproc, '/'), getusername (), - "-subject", buf, NULL); + arglist = argsplit(mailproc, &program, &argp); + + arglist[argp++] = getusername(); + arglist[argp++] = "-subject"; + arglist[argp++] = buf; + arglist[argp] = NULL; + + execvp (program, arglist); fprintf (stderr, "unable to exec "); perror (mailproc); _exit (-1);