summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main/php_virtual_cwd.c11
-rw-r--r--main/php_virtual_cwd.h16
2 files changed, 16 insertions, 11 deletions
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 <limits.h>
#include <errno.h>
#include <stdlib.h>
-#include <ctype.h>
#include <fcntl.h>
#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 <unistd.h>
#endif
+#include <ctype.h>
+
#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 <dirent.h>
#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