summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-05-20 07:41:35 +0000
committerDmitry Stogov <dmitry@php.net>2008-05-20 07:41:35 +0000
commit50983e372c529a704dd62e659c3d63043d3fb7a4 (patch)
tree553aa901440a96852a8b66e37a2c985389acc87f /TSRM
parent07d6758c86200d85527660989e7aa3c6f37b4f85 (diff)
downloadphp-git-50983e372c529a704dd62e659c3d63043d3fb7a4.tar.gz
proper fix
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/tsrm_virtual_cwd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c
index ec729465ca..da6a380bb2 100644
--- a/TSRM/tsrm_virtual_cwd.c
+++ b/TSRM/tsrm_virtual_cwd.c
@@ -491,6 +491,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
int use_relative_path = 0;
#ifdef TSRM_WIN32
int is_unc;
+ int exists;
#endif
TSRMLS_FETCH();
@@ -589,6 +590,7 @@ no_realpath:
CWD_STATE_COPY(&old_state, state);
#ifdef TSRM_WIN32
+ exists = (use_realpath != CWD_EXPAND);
ret = 0;
is_unc = 0;
if (path_length >= 2 && path[1] == ':') {
@@ -696,13 +698,16 @@ no_realpath:
ptr_length = length;
FindClose(hFind);
ret = 0;
- } else if (use_realpath == CWD_REALPATH) {
+ } else {
if (is_unc) {
/* skip share name */
is_unc--;
ret = 0;
} else {
- ret = 1;
+ exists = 0;
+ if (use_realpath == CWD_REALPATH) {
+ ret = 1;
+ }
}
}
}
@@ -743,7 +748,7 @@ no_realpath:
/* Store existent file in realpath cache. */
#ifdef TSRM_WIN32
- if (use_cache && !is_unc && (use_realpath == CWD_REALPATH)) {
+ if (use_cache && !is_unc && exists) {
#else
if (use_cache && (use_realpath == CWD_REALPATH)) {
#endif