diff options
author | George Hazan <ghazan@miranda.im> | 2021-03-23 23:01:54 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-03-23 23:01:54 +0300 |
commit | 0874caae9d97e343a4b48742f52ba3dc7b1db497 (patch) | |
tree | 0e92b82effd080b74cc8935c1990497f8fe4d7f5 | |
parent | b63efb1fbceb4127c164377015889a979330a437 (diff) |
fix for correct file deletion
-rw-r--r-- | plugins/PluginUpdater/src/DlgUpdate.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 7af4a7fa33..9ead0a0ba2 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -629,8 +629,10 @@ static bool CheckFileRename(const wchar_t *pwszOldName, wchar_t *pNewName) static bool isValidExtension(const wchar_t *pwszFileName)
{
const wchar_t *pExt = wcsrchr(pwszFileName, '.');
+ if (pExt == nullptr)
+ return false;
- return (pExt != nullptr) && (!_wcsicmp(pExt, L".dll") || !_wcsicmp(pExt, L".exe") || !_wcsicmp(pExt, L".txt") || !_wcsicmp(pExt, L".bat"));
+ return !_wcsicmp(pExt, L".dll") || !_wcsicmp(pExt, L".exe") || !_wcsicmp(pExt, L".txt") || !_wcsicmp(pExt, L".bat") || !_wcsicmp(pExt, L".cmd");
}
// We only scan subfolders "Plugins", "Icons", "Languages", "Libs", "Core"
@@ -688,7 +690,7 @@ static int ScanFolder(const wchar_t *pwszFolder, size_t cbBaseLen, const wchar_t }
}
else {
- if (level == 1 && !wcsicmp(ffd.cFileName, L"libmdbx.mir")) // move Libs\\libmdbx.mir to the root folder
+ if (level < 2 && !wcsicmp(ffd.cFileName, L"libmdbx.mir")) // move Libs\\libmdbx.mir to the root folder
wszNewName[0] = 0;
else if (!wcsicmp(ffd.cFileName, L"libeay32.mir") || !wcsicmp(ffd.cFileName, L"ssleay32.mir")) // remove old OpenSSL modules
wszNewName[0] = 0;
|