From 1620f043e85dd61edd6a520245e02e01f249c465 Mon Sep 17 00:00:00 2001 From: fangyunzhong Date: Wed, 7 Jun 2023 11:27:19 +0000 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=8F=82=E6=95=B0=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E8=B7=AF=E5=BE=84=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangyunzhong --- src/file_entry.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); }