1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-24 04:33:24 +00:00
freebsd-ports/misc/deco/files/patch-run.c
2004-12-06 11:26:33 +00:00

27 lines
544 B
C

--- run.c Wed Mar 7 19:37:47 2001
+++ run.c Sun Dec 5 22:51:12 2004
@@ -136,10 +136,22 @@
{
va_list ap;
int err;
+ char **argv, **argp;
+ int argc;
+ argc = 1;
va_start (ap, name);
- err = run (name, ap, execve, silent);
+ while (va_arg (ap, char *) != NULL)
+ argc++;
va_end (ap);
+ argv = (char **) malloc (argc * sizeof (char *));
+ argp = argv;
+ va_start (ap, name);
+ while ((*argp++ = va_arg (ap, char *)) != NULL);
+ *argp = NULL;
+ va_end (ap);
+ err = run (name, argv, execve, silent);
+ free (argv);
return err;
}