From 1cf7d666be7faf5d94ccd0b25ddb5492c5cf5d22 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 13 Apr 2018 13:06:44 +0300 Subject: fixes #1259 (Crash when trying import profile to itself) --- plugins/Import/src/miranda.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins') 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); -- cgit v1.2.3