From: Ken Hornstein Date: Tue, 29 Jan 2013 20:58:34 +0000 (-0500) Subject: Switch the editor invocation over to use argsplit(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/7e79d0057f04eb7bb7e98f5d3161592e6c640599?hp=-c Switch the editor invocation over to use argsplit(). --- 7e79d0057f04eb7bb7e98f5d3161592e6c640599 diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index 57d72825..c9cbf503 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -644,7 +644,7 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, { int pid, status, vecp; char altpath[BUFSIZ], linkpath[BUFSIZ]; - char *cp, *vec[MAXARGS]; + char *cp, *prog, **vec; struct stat st; #ifdef HAVE_LSTAT @@ -712,15 +712,15 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, m_putenv ("editalt", altpath); } - vecp = 0; - vec[vecp++] = r1bindex (*ed, '/'); + vec = argsplit(*ed, &prog, &vecp); + if (arg) while (*arg) vec[vecp++] = *arg++; vec[vecp++] = file; vec[vecp] = NULL; - execvp (*ed, vec); + execvp (prog, vec); fprintf (stderr, "unable to exec "); perror (*ed); _exit (-1);