From 3327379d2738f187c1a25acf0c9ffb134ac5aa7a Mon Sep 17 00:00:00 2001 From: liduo Date: Thu, 23 Oct 2025 10:50:28 +0800 Subject: [PATCH] =?UTF-8?q?stat=E5=87=BD=E6=95=B0=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E8=BF=94=E5=9B=9E=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liduo --- src/file_entry.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/file_entry.cpp b/src/file_entry.cpp index 84fa530..cb30e42 100644 --- a/src/file_entry.cpp +++ b/src/file_entry.cpp @@ -183,7 +183,9 @@ bool FileEntry::IsDirectory(const string &path) return true; #else struct stat s; - stat(path.c_str(), &s); + if (stat(path.c_str(), &s) != 0) { + return false; + } return S_ISDIR(s.st_mode); #endif }