You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Philip Martin <ph...@codematters.co.uk> on 2005/10/17 22:15:21 UTC
[PATCH] win32 apr_proc_create empty parameters
A recent thread on the Subversion list concerned passing empty
parameters, i.e. a "" string, to apr_proc_create; it appears that APR
causes such parameters to disappear on Windows:
http://svn.haxx.se/dev/archive-2005-09/1142.shtml
There was a claim that CreateProcess supports "":
http://svn.haxx.se/dev/archive-2005-09/1131.shtml
I not a Windows expert, and I don't have a Windows box to test, but
this patch should cause APR to pass "":
Index: threadproc/win32/proc.c
===================================================================
--- threadproc/win32/proc.c (revision 325972)
+++ threadproc/win32/proc.c (working copy)
@@ -460,7 +460,7 @@
/* Handle the args, seperate from argv0 */
cmdline = "";
for (i = 1; args && args[i]; ++i) {
- if (has_space(args[i])) {
+ if (has_space(args[i]) || !args[i][0]) {
cmdline = apr_pstrcat(pool, cmdline, " \"", args[i], "\"", NULL);
}
else {
--
Philip Martin
Re: [PATCH] win32 apr_proc_create empty parameters
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 10/17/05, Philip Martin <ph...@codematters.co.uk> wrote:
> A recent thread on the Subversion list concerned passing empty
> parameters, i.e. a "" string, to apr_proc_create; it appears that APR
> causes such parameters to disappear on Windows:
>
> http://svn.haxx.se/dev/archive-2005-09/1142.shtml
>
> There was a claim that CreateProcess supports "":
>
> http://svn.haxx.se/dev/archive-2005-09/1131.shtml
>
> I not a Windows expert, and I don't have a Windows box to test, but
> this patch should cause APR to pass "":
Bill Wrowe took a look at this and says it seems fine, so I just
committed it in r355792.
Thanks,
-garrett