diff --git a/src/file_entry.cpp b/src/file_entry.cpp index 064feaf..d116512 100644 --- a/src/file_entry.cpp +++ b/src/file_entry.cpp @@ -179,7 +179,7 @@ string FileEntry::RealPath(const string &path) { #ifdef _WIN32 char buffer[MAX_PATH]; - if (!PathCanonicalize(buffer, AdaptLongPath(path).c_str())) { + if (!PathCanonicalize(buffer, path.c_str())) { return ""; } @@ -193,6 +193,9 @@ string FileEntry::RealPath(const string &path) if (!PathCombine(temp, current, buffer)) { return ""; } + if (!Exist(string(temp))) { + return ""; + } return string(temp); } #else @@ -201,6 +204,9 @@ string FileEntry::RealPath(const string &path) return ""; } #endif + if (!Exist(string(buffer))) { + return ""; + } return string(buffer); }