httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Parzygnat" <kp...@raleigh.ibm.com>
Subject RE: [PATCH] Win32 device files
Date Mon, 07 Dec 1998 21:06:57 GMT
Grrrr... iStart declared as wrong type, 
here's a refresh.



--- http_request.c.first	Thu Dec 03 14:29:14 1998
+++ http_request.c	Mon Dec 07 21:01:14 1998
@@ -179,7 +179,6 @@
     char *last_cp = NULL;
     int rv;
 #ifdef WIN32
-    char buf[5];
     BOOL bStripSlash=TRUE;
 #endif

@@ -189,16 +188,12 @@
     }

 #ifdef WIN32
-    /* If the path is x:/, then convert it to x:/., coz that's what stat
-     * needs to work properly
+    /* If the directory is x:\, then we don't want to strip
+     * the trailing slash since x: is not a valid directory.
      */
-    if (strlen(path) == 3 && path[1] == ':') {
-	strcpy(buf,path);
-	buf[3]='.';
-	buf[4]='\0';
-	path=buf;
-	end=buf+4;
-    }
+    if (strlen(path) == 3 && path[1] == ':' && path[2] == '/')
+        bStripSlash = FALSE;
+

     /* If UNC name == //machine/share/, do not
      * advance over the trailing slash.  Any other
@@ -333,7 +328,7 @@
     char *test_filename;
     char *test_dirname;
     int res;
-    unsigned i, num_dirs;
+    unsigned i, num_dirs, iStart;
     int j, test_filename_len;

     /*
@@ -441,9 +436,18 @@
      */
     test_dirname = ap_palloc(r->pool, test_filename_len + 2);

+    iStart = 1;
+#ifdef WIN32
+    /* If the name is a UNC name, then do not walk through the
+     * machine and share name (e.g. \\machine\share\)
+     */
+    if (num_dirs > 3 && test_filename[0] == '/' && test_filename[1] ==
'/')
+        iStart = 4;
+#endif
+
     /* j keeps track of which section we're on, see core_reorder_directories */
     j = 0;
-    for (i = 1; i <= num_dirs; ++i) {
+    for (i = iStart; i <= num_dirs; ++i) {
         int overrides_here;
         core_dir_config *core_dir = (core_dir_config *)
             ap_get_module_config(per_dir_defaults, &core_module);

- - - - - - - - - - - - - - - - - -
Ken Parzygnat
email: kparz@raleigh.ibm.com 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > --------------------------------------------------------------------------------
> > Users of the Apache webserver are hereby granted a non-exclusive, irrevocable,
> > world-wide, royalty-free, non-transferable license to use, execute, prepare
> > derivative works of, and distribute (internally and externally, and including
> > derivative works) the code accompanying this license as part of, and
> > integrated into the Apache webserver.  This code is provided "AS IS" WITHOUT
> > WARRANTY OF ANY KIND EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
> > THE IMPLIED WARRANTY OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> > AND ANY WARRANTY OF NON-INFRINGEMENT.  THE ENTIRE RISK ARISING OUT OF THE USE
> > OR PERFORMANCE OF THIS CODE REMAINS WITH USERS OF THE APACHE WEBSERVER.  The
> > owner of this code represents and warrants that it is legally entitled to
> > grant the above license.
> > 
> 

Mime
View raw message