rbb 99/12/16 05:14:57
Modified: src/lib/apr/threadproc/win32 proc.c
Log:
Fix create_process on Win32.i CGI's work now.
Submitted by: Allan Edwards
Reviewed by: Ryan Bloom
Revision Changes Path
1.14 +17 -2 apache-2.0/src/lib/apr/threadproc/win32/proc.c
Index: proc.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/win32/proc.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- proc.c 1999/12/15 01:15:30 1.13
+++ proc.c 1999/12/16 13:14:56 1.14
@@ -154,7 +154,7 @@
char path[MAX_PATH];
int length;
- if (dir[0] != '\\' && dir[1] != ':') {
+ if (dir[0] != '\\' && dir[0] != '/' && dir[1] != ':') {
length = GetCurrentDirectory(MAX_PATH, path);
if (length == 0 || length + strlen(dir) + 1 >= MAX_PATH)
@@ -229,11 +229,26 @@
}
if (attr->cmdtype == APR_PROGRAM) {
- if (attr->currdir == NULL) {
+ char *ptr = progname;
+
+ if (*ptr =='"') {
+ ptr++;
+ }
+
+ if (*ptr == '\\' || *++ptr == ':') {
+ cmdline = ap_pstrdup(cont, progname);
+ }
+ else if (attr->currdir == NULL) {
cmdline = ap_pstrdup(cont, progname);
}
else {
+ char lastchar = attr->currdir[strlen(attr->currdir)-1];
+ if ( lastchar == '\\' || lastchar == '/') {
+ cmdline = ap_pstrcat(cont, attr->currdir, progname, NULL);
+ }
+ else {
cmdline = ap_pstrcat(cont, attr->currdir, "\\", progname, NULL);
+ }
}
}
else {