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 4ecc9b2..1696def 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())) {