summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-02-03 15:27:33 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-02-03 15:27:33 +0300
commitb31af4096a56ad4ada750d2df519023a8cbc6538 (patch)
tree009584360c96bd3fc769447d4b5a520526f48d48 /plugins
parentf06df79eedfdef7ee180ca5d3c8becfa605da516 (diff)
fixes #4160 (Апдейтер не стирает старые библиотеки OpenSSL)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/PluginUpdater/src/DlgUpdate.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp
index 1b3080a268..ba31e29480 100644
--- a/plugins/PluginUpdater/src/DlgUpdate.cpp
+++ b/plugins/PluginUpdater/src/DlgUpdate.cpp
@@ -603,13 +603,16 @@ static bool CheckFileRename(const wchar_t *pwszFolder, const wchar_t *pwszOldNam
/////////////////////////////////////////////////////////////////////////////////////////
// We only update ".dll", ".exe", ".txt" and ".bat"
+static wchar_t wszExtensionList[][5] = { L".dll", L".exe", L".txt", L".bat", L".cmd", L".mir" };
+
static bool isValidExtension(const wchar_t *pwszFileName)
{
- const wchar_t *pExt = wcsrchr(pwszFileName, '.');
- if (pExt == nullptr)
- return false;
-
- return !_wcsicmp(pExt, L".dll") || !_wcsicmp(pExt, L".exe") || !_wcsicmp(pExt, L".txt") || !_wcsicmp(pExt, L".bat") || !_wcsicmp(pExt, L".cmd");
+ if (const wchar_t *pExt = wcsrchr(pwszFileName, '.'))
+ for (auto &it : wszExtensionList)
+ if (!_wcsicmp(pExt, it))
+ return true;
+
+ return false;
}
// We only scan subfolders "Plugins", "Icons", "Languages", "Libs", "Core"