summaryrefslogtreecommitdiff
path: root/misc/deco/files/patch-run.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2004-12-06 11:26:33 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2004-12-06 11:26:33 +0000
commitd45ba9f4a2f536a4e296925cf83e08b9b422b671 (patch)
treed78bad7000cf40a053208f6921d232baa5215a2e /misc/deco/files/patch-run.c
parentUpdate to 0.71. (diff)
Fixed to work on amd64.
Notes
Notes: svn path=/head/; revision=123307
Diffstat (limited to 'misc/deco/files/patch-run.c')
-rw-r--r--misc/deco/files/patch-run.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/misc/deco/files/patch-run.c b/misc/deco/files/patch-run.c
new file mode 100644
index 000000000000..0f2fcd6a7360
--- /dev/null
+++ b/misc/deco/files/patch-run.c
@@ -0,0 +1,26 @@
+--- 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;
+ }
+