]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #31347 (is_dir and is_file (incorrectly) return true for any
authorIlia Alshanetsky <iliaa@php.net>
Tue, 20 Dec 2005 14:28:03 +0000 (14:28 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 20 Dec 2005 14:28:03 +0000 (14:28 +0000)
string greater then 255 characters).

TSRM/tsrm_config_common.h
TSRM/tsrm_virtual_cwd.c
main/php.h

index 23dc9bfd792ca7ba23bf7f7b1c1f7940a8b732ac..ea1eef11cac3bdb48f3a50b6c3e11aa81f929e07 100644 (file)
@@ -42,6 +42,8 @@ char *alloca ();
 #ifndef MAXPATHLEN
 # ifdef PATH_MAX
 #  define MAXPATHLEN PATH_MAX
+# elif defined(MAX_PATH)
+#  define MAXPATHLEN MAX_PATH
 # else
 #  define MAXPATHLEN 256
 # endif
index d8560d5a62ef2ec9b3c0be142e3571f211d08f51..a9382ac3636440f73e1ffe238c280c932804e53a 100644 (file)
@@ -700,7 +700,9 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
        int retval;
 
        CWD_STATE_COPY(&new_state, &CWDG(cwd));
-       virtual_file_ex(&new_state, path, NULL, 1);
+       if (virtual_file_ex(&new_state, path, NULL, 1)) {
+               return -1;
+       }
 
        retval = stat(new_state.cwd, buf);
 
index 9b5a26cfd3563612fcd6004fbb97cc72f6ca14d1..615b0c7b20222014242b01f9199d0644129b5fde 100644 (file)
@@ -232,6 +232,8 @@ char *strerror(int);
 #ifndef MAXPATHLEN
 # ifdef PATH_MAX
 #  define MAXPATHLEN PATH_MAX
+# elif defined(MAX_PATH)
+#  define MAXPATHLEN MAX_PATH
 # else
 #  define MAXPATHLEN 256    /* Should be safe for any weird systems that do not define it */
 # endif