From 3b8331c8e3d51855375e8e182b878e0e7e476f2c Mon Sep 17 00:00:00 2001 From: fangyunzhong Date: Fri, 16 Jun 2023 08:47:28 +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 260b2bc..02beadb 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, AdapateLongPath(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); }