summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2003-12-04 17:02:09 (GMT)
committerWez Furlong <wez@php.net>2003-12-04 17:02:09 (GMT)
commit9a1ddeae65f7661bed3f8fef3d92565ec2ab93a2 (patch)
treecbd264e799419aae485f575b810b3ae1e8539f38 /TSRM
parente13e315a10cff71e83b71d50d2092fa50f10b3c7 (diff)
downloadphp-9a1ddeae65f7661bed3f8fef3d92565ec2ab93a2.tar.gz
Fix Andi's GetLongPathName code so that virtual_file_ex doesn't
fail if the file does not exist.
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/tsrm_virtual_cwd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c
index 0d9fb71..cc4ba88 100644
--- a/TSRM/tsrm_virtual_cwd.c
+++ b/TSRM/tsrm_virtual_cwd.c
@@ -347,12 +347,15 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
return 1;
}
- if (GetLongPathName(path, new_path, new_path_length) == 0) {
+ if (GetLongPathName(path, new_path, new_path_length) != 0) {
+ path = new_path;
+ path_length = new_path_length;
+ } else {
free(new_path);
- return 1;
+ if (GetLastError() != ERROR_FILE_NOT_FOUND) {
+ return 1;
+ }
}
- path = new_path;
- path_length = new_path_length;
}
#endif
free_path = path_copy = tsrm_strndup(path, path_length);