]> granicus.if.org Git - apache/commitdiff
Move more path parsing fixes forward from 1.3
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 12 Oct 2000 14:22:30 +0000 (14:22 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 12 Oct 2000 14:22:30 +0000 (14:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86564 13f79535-47bb-0310-9956-ffa450edef68

os/os2/os-inline.c
os/win32/os.h

index fc165e83220db1780f2d8d30be951f30e9d580b8..f9a660d16c6cb62c72397196ea43128ee2153191 100644 (file)
 
 INLINE int ap_os_is_path_absolute(const char *file)
 {
-  /* For now, just do the same check that http_request.c and mod_alias.c
-   * do. 
+  /* For now, just do the same check that http_request.c and mod_alias.c do. 
+   * XXX: Accept /bleh still?  Or do we concur that d:/bleh is a minimum
+   *      requirement?  If so, canonical name needs to convert to drive/path
+   *      syntax, and the test becomes (file[0] == '/' && file[1] == '/') ||...
    */
-  return file && (file[0] == '/' || file[1] == ':');
+  return file && (file[0] == '/' || (file[1] == ':' && file[2] == '/'));
 }
index da88ddb543be148f2da03ac35a9414c2f7413661..295a03042fac4544246c552b6ba9bc14dce094f1 100644 (file)
@@ -137,10 +137,12 @@ typedef char * caddr_t;
 
 __inline int ap_os_is_path_absolute(const char *file)
 {
-  /* For now, just do the same check that http_request.c and mod_alias.c
-   * do. 
+  /* For now, just do the same check that http_request.c and mod_alias.c do. 
+   * XXX: Accept /bleh still?  Or do we concur that d:/bleh is a minimum
+   *      requirement?  If so, canonical name needs to convert to drive/path
+   *      syntax, and the test becomes (file[0] == '/' && file[1] == '/') ||...
    */
-  return file[0] == '/' || file[1] == ':';
+  return file && (file[0] == '/' || (file[1] == ':' && file[2] == '/'));
 }
 
 /* OS-dependent filename routines in util_win32.c */