]> granicus.if.org Git - php/commitdiff
Fixed realpath cache for existent file with CWD_FILEPATH flag on win32
authorDmitry Stogov <dmitry@php.net>
Tue, 23 Oct 2007 05:57:25 +0000 (05:57 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 23 Oct 2007 05:57:25 +0000 (05:57 +0000)
TSRM/tsrm_virtual_cwd.c

index 48ebd1f0a6d63f5656c06d822bcf780ef9a8c5c7..6ed33bdea2d0e7cc95c76e25a213c53cf4a9bd48 100644 (file)
@@ -489,6 +489,9 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
        int ret;
        int use_cache;
        int use_relative_path = 0;
+#ifdef TSRM_WIN32
+       int is_unc;
+#endif
        TSRMLS_FETCH();
 
        use_cache = ((use_realpath != CWD_EXPAND) && CWDG(realpath_cache_size_limit));
@@ -573,9 +576,6 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
                char *ptr, *path_copy, *free_path;
                char *tok;
                int ptr_length;
-#ifdef TSRM_WIN32
-               int is_unc;
-#endif
 no_realpath:
 
 #ifdef TSRM_WIN32
@@ -738,7 +738,12 @@ no_realpath:
                }
        }
 
+       /* Store existent file in realpath cache. */
+#ifdef TSRM_WIN32
+       if (use_cache && !is_unc) {
+#else
        if (use_cache && (use_realpath == CWD_REALPATH)) {
+#endif
                realpath_cache_add(path, path_length, state->cwd, state->cwd_length, t TSRMLS_CC);
        }