From f99586358aaace2891557b84328ff8dad52220f5 Mon Sep 17 00:00:00 2001 From: liduo Date: Fri, 8 Aug 2025 19:06:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=E5=89=8D?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=96=87=E4=BB=B6=E6=98=AF=E5=90=A6=E5=AD=98?= =?UTF-8?q?=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liduo --- src/file_entry.cpp | 3 +++ src/resource_append.cpp | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/file_entry.cpp b/src/file_entry.cpp index 8d87036..6083dec 100644 --- a/src/file_entry.cpp +++ b/src/file_entry.cpp @@ -297,6 +297,9 @@ bool FileEntry::IsIgnore(const string &filename) const bool FileEntry::RemoveAllDirInner(const FileEntry &entry) { string path = entry.GetFilePath().GetPath(); + if (!Exist(path)) { + return true; + } if (entry.IsFile()) { #ifdef _WIN32 bool result = remove(AdaptLongPath(path).c_str()) == 0; diff --git a/src/resource_append.cpp b/src/resource_append.cpp index e1f7bbd..08ed0cc 100644 --- a/src/resource_append.cpp +++ b/src/resource_append.cpp @@ -90,7 +90,12 @@ bool ResourceAppend::Combine(const string &folderPath) .FormatCause(child->GetFilePath().GetPath().c_str(), "not a file")); return false; } - if (child->GetFilePath().GetFilename() == ID_DEFINED_FILE) { + const std::string fileName = child->GetFilePath().GetFilename(); + if (fileName == ID_DEFINED_FILE) { + continue; + } + if (fileName.find('.') == 0) { + // The file starts with '.' is invalid continue; } if (!LoadResourceItem(child->GetFilePath().GetPath())) { -- Gitee