]> granicus.if.org Git - php/commitdiff
expand IS_ABSOLUTE_PATH on Windows, so then strlen() isn't called twice
authorAnatol Belski <ab@php.net>
Fri, 19 Sep 2014 13:44:04 +0000 (15:44 +0200)
committerAnatol Belski <ab@php.net>
Fri, 19 Sep 2014 14:30:03 +0000 (16:30 +0200)
Zend/zend_virtual_cwd.h

index 3c432de9addb1604a9e14b7739a42408c65a4b5f..8bc0d272b752cc2d66d883d2c53b65160bc0db6d 100644 (file)
@@ -70,7 +70,7 @@ typedef unsigned short mode_t;
 #define IS_UNC_PATH(path, len) \
        (len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1]))
 #define IS_ABSOLUTE_PATH(path, len) \
-       (len >= 2 && ((isalpha(path[0]) && path[1] == ':') || IS_UNC_PATH(path, len)))
+       (len >= 2 && ((/* is local */isalpha(path[0]) && path[1] == ':') || /* is UNC */IS_SLASH(path[0]) && IS_SLASH(path[1])))
 
 #elif defined(NETWARE)
 #ifdef HAVE_DIRENT_H