summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-13 13:06:44 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-13 13:06:44 +0300
commit1cf7d666be7faf5d94ccd0b25ddb5492c5cf5d22 (patch)
tree9cee5a308bf1412d9b58e6b437ec3295e6104de9 /plugins
parentba00e60921f9a63a2b6157fc10a98f4db99aaa6b (diff)
fixes #1259 (Crash when trying import profile to itself)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Import/src/miranda.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp
index d2fef1228c..56b28849b2 100644
--- a/plugins/Import/src/miranda.cpp
+++ b/plugins/Import/src/miranda.cpp
@@ -135,6 +135,11 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR
ofn.nMaxFile = _countof(str);
ofn.lpstrInitialDir = pfd;
if (GetOpenFileName(&ofn)) {
+ if (!mir_wstrcmpi(str, VARSW(L"%miranda_userdata%\\%miranda_profilename%.dat"))) {
+ MessageBoxW(nullptr, TranslateT("You cannot import your current profile into itself"), L"Miranda NG", MB_OK | MB_ICONERROR);
+ break;
+ }
+
SetDlgItemText(hwndDlg, IDC_FILENAME, str);
SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCURSEL, -1, 0);
SendMessage(GetParent(hwndDlg), WIZM_ENABLEBUTTON, 1, 0);