From: Sascha Schumann Date: Sun, 27 Aug 2000 19:36:35 +0000 (+0000) Subject: Export IS_ABSOLUTE_PATH to the outside world. X-Git-Tag: php-4.0.2~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=626fc9a7732fa07a1dc9cd861818b049c9862b21;p=php Export IS_ABSOLUTE_PATH to the outside world. --- diff --git a/main/php_virtual_cwd.c b/main/php_virtual_cwd.c index 6de1764033..e9132ad194 100644 --- a/main/php_virtual_cwd.c +++ b/main/php_virtual_cwd.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #ifdef ZEND_WIN32 @@ -68,13 +67,9 @@ cwd_state main_cwd_state; /* True global */ #ifdef ZEND_WIN32 #define php_strtok_r(a,b,c) strtok((a),(b)) -#define IS_SLASH(c) ((c) == '/' || (c) == '\\') #define DEFAULT_SLASH '\\' #define TOKENIZER_STRING "/\\" -#define IS_ABSOLUTE_PATH(path, len) \ - (len >= 2 && isalpha(path[0]) && path[1] == ':') - #define COPY_WHEN_ABSOLUTE 2 static int php_check_dots(const char *element, int n) @@ -92,7 +87,6 @@ static int php_check_dots(const char *element, int n) #else -#define IS_SLASH(c) ((c) == '/') #define DEFAULT_SLASH '/' #define TOKENIZER_STRING "/" #endif @@ -100,11 +94,6 @@ static int php_check_dots(const char *element, int n) /* default macros */ -#ifndef IS_ABSOLUTE_PATH -#define IS_ABSOLUTE_PATH(path, len) \ - (IS_SLASH(path[0])) -#endif - #ifndef IS_DIRECTORY_UP #define IS_DIRECTORY_UP(element, len) \ (len == 2 && memcmp(element, "..", 2) == 0) diff --git a/main/php_virtual_cwd.h b/main/php_virtual_cwd.h index 6b6606cc17..03b100d8c2 100644 --- a/main/php_virtual_cwd.h +++ b/main/php_virtual_cwd.h @@ -36,12 +36,28 @@ #include #endif +#include + #ifdef ZEND_WIN32 #include "win32/readdir.h" + +#define IS_SLASH(c) ((c) == '/' || (c) == '\\') + +#define IS_ABSOLUTE_PATH(path, len) \ + (len >= 2 && isalpha(path[0]) && path[1] == ':') + #else #ifdef HAVE_DIRENT_H #include #endif + +#define IS_SLASH(c) ((c) == '/') + +#endif + +#ifndef IS_ABSOLUTE_PATH +#define IS_ABSOLUTE_PATH(path, len) \ + (IS_SLASH(path[0])) #endif #if HAVE_UTIME