From 9a1ddeae65f7661bed3f8fef3d92565ec2ab93a2 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 4 Dec 2003 17:02:09 +0000 Subject: [PATCH] Fix Andi's GetLongPathName code so that virtual_file_ex doesn't fail if the file does not exist. --- TSRM/tsrm_virtual_cwd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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); -- 2.40.0