]> granicus.if.org Git - apache/commitdiff
For Win32 cgi %1 arguments, use backslashes. For $1, use posix slashes.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 21 Oct 2001 06:32:47 +0000 (06:32 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 21 Oct 2001 06:32:47 +0000 (06:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91617 13f79535-47bb-0310-9956-ffa450edef68

modules/arch/win32/mod_win32.c

index 923d1836e0bd744de9d4c4fc32689a3b224e0b0c..8b16ce2cbda77aba657dce19d95afe5610bd9358 100644 (file)
@@ -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;
         }