]> granicus.if.org Git - php/commitdiff
removed redundant CLIB_STAT_PATCH checks. defined the IS_ABSOLUTE_PATH macros to...
authorAnantha Kesari H Y <hyanantha@php.net>
Fri, 8 Oct 2004 09:48:20 +0000 (09:48 +0000)
committerAnantha Kesari H Y <hyanantha@php.net>
Fri, 8 Oct 2004 09:48:20 +0000 (09:48 +0000)
TSRM/tsrm_virtual_cwd.h

index 00daf0bb777388228b944f53addc6742b79f2222..bc06a21c64caafeaa563d9cde19ac955b02e52f3 100644 (file)
@@ -70,14 +70,15 @@ typedef unsigned short mode_t;
 #include <dirent.h>
 #endif
 
-#define DEFAULT_SLASH '/'
+#define DEFAULT_SLASH '\\'
 #define DEFAULT_DIR_SEPARATOR  ';'
 #define IS_SLASH(c)    ((c) == '/' || (c) == '\\')
 #define IS_SLASH_P(c)  IS_SLASH(*(c))
 #define COPY_WHEN_ABSOLUTE(path) \
     (strchr(path, ':') - path + 1)  /* Take the volume name which ends with a colon */
+/* Colon indicates volume name, either first character should be forward slash or backward slash */
 #define IS_ABSOLUTE_PATH(path, len) \
-    (strchr(path, ':') != NULL) /* Colon indicates volume name */
+    ((strchr(path, ':') != NULL) || ((len >= 1) && ((path[0] == '/') || (path[0] == '\\'))))
 
 #else
 #ifdef HAVE_DIRENT_H
@@ -141,11 +142,7 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC);
 CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...);
 CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC);
 CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC);
-#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
 CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
-#else
-CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC);
-#endif
 #if !defined(TSRM_WIN32) && !defined(NETWARE)
 CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC);
 #endif