From: Wez Furlong Date: Thu, 4 Dec 2003 17:02:09 +0000 (+0000) Subject: Fix Andi's GetLongPathName code so that virtual_file_ex doesn't X-Git-Tag: php-5.0.0b3RC1~325 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a1ddeae65f7661bed3f8fef3d92565ec2ab93a2;p=php Fix Andi's GetLongPathName code so that virtual_file_ex doesn't fail if the file does not exist. --- diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index 0d9fb7197c..cc4ba889d9 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);