summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-07-19 15:23:41 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-07-19 15:23:41 +0300
commit1f093124cba611950c465933812736315a0f630b (patch)
tree44f20aef24519cc4291fd15ec62d75cd044e3729 /src
parentdb8b4d13f503fb472ae9c8c2314597ede2ed6e98 (diff)
fixes #3587 (PluginUpdater: не создавать пустой бэкап, когда существующие файлы не изменились)
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/profilemanager.cpp5
-rw-r--r--src/mir_core/src/Windows/fileutil.cpp4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp
index ab7f00edf0..2a8d409a42 100644
--- a/src/mir_app/src/profilemanager.cpp
+++ b/src/mir_app/src/profilemanager.cpp
@@ -103,10 +103,7 @@ static BOOL EnumProfilesForList(const wchar_t *tszFullPath, wchar_t *profile, CC
static int findProfiles(CCtrlListView &list, const wchar_t *szProfile)
{
// find in Miranda NG profile subfolders
- MFilePath searchspec;
- searchspec.Format(L"%s\\*.*", g_profileDir);
-
- for (auto &it: searchspec.search()) {
+ for (auto &it: MFilePath(g_profileDir).search()) {
// find all subfolders except "." and ".."
if (!it.isDir() || !wcscmp(it.getPath(), L".") || !wcscmp(it.getPath(), L".."))
continue;
diff --git a/src/mir_core/src/Windows/fileutil.cpp b/src/mir_core/src/Windows/fileutil.cpp
index a0dcee68f6..a7494bc8b7 100644
--- a/src/mir_core/src/Windows/fileutil.cpp
+++ b/src/mir_core/src/Windows/fileutil.cpp
@@ -74,5 +74,9 @@ bool MFilePath::move(const wchar_t *pwszDest)
MFilePath::MFileIterator MFilePath::search()
{
+ DWORD dwAttr = GetFileAttributesW(c_str());
+ if (dwAttr != -1 && (dwAttr & FILE_ATTRIBUTE_DIRECTORY))
+ return MFileIterator(*this + L"\\*");
+
return MFileIterator(c_str());
}