From: William A. Rowe Jr Date: Sun, 21 Oct 2001 06:32:47 +0000 (+0000) Subject: For Win32 cgi %1 arguments, use backslashes. For $1, use posix slashes. X-Git-Tag: 2.0.27~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f16b9549064f55d03b98a1802fa3b6730ade18ee;p=apache For Win32 cgi %1 arguments, use backslashes. For $1, use posix slashes. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91617 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/arch/win32/mod_win32.c b/modules/arch/win32/mod_win32.c index 923d1836e0..8b16ce2cbd 100644 --- a/modules/arch/win32/mod_win32.c +++ b/modules/arch/win32/mod_win32.c @@ -302,9 +302,17 @@ static apr_array_header_t *split_argv(apr_pool_t *p, const char *interp, const c continue; } if (((*ch == '$') || (*ch == '%')) && (*(ch + 1) == '1')) { + /* Todo: Make short name!!! */ prgtaken = 1; arg = (const char**)apr_array_push(args); - *arg = cgiprg; + if (*ch == '%') { + char *repl = apr_pstrdup(p, cgiprg); + while ((repl = strchr(repl, '/'))) + *repl++ = '\\'; + *arg = repl; + } + else + *arg = cgiprg; ch += 2; continue; } @@ -313,7 +321,14 @@ static apr_array_header_t *split_argv(apr_pool_t *p, const char *interp, const c && (*(ch + 3) == '\"')) { prgtaken = 1; arg = (const char**)apr_array_push(args); - *arg = cgiprg; + if (*(ch + 1) == '%') { + char *repl = apr_pstrdup(p, cgiprg); + while ((repl = strchr(repl, '/'))) + *repl++ = '\\'; + *arg = repl; + } + else + *arg = cgiprg; ch += 4; continue; }