Manager: Detect system files correctly during add and pull operations

This commit is contained in:
Riyyi
2022-01-24 00:29:50 +01:00
parent d7ff637fd0
commit 5d5c37a496
+5 -1
View File
@@ -385,7 +385,11 @@ bool Dotfile::include(const std::filesystem::path& path, const std::vector<std::
bool Dotfile::isSystemTarget(const std::string& target) bool Dotfile::isSystemTarget(const std::string& target)
{ {
for (const auto& systemDirectory : m_systemDirectories) { for (const auto& systemDirectory : m_systemDirectories) {
if (target.find(systemDirectory) - m_workingDirectorySize == 0) {
if (target.find(systemDirectory) == 0) {
return true;
}
if (target.find(m_workingDirectory / systemDirectory) == 0) {
return true; return true;
} }
} }