From 04422a4866cbc64659a70ce3759ccccb73b69dda Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 31 Aug 2020 18:55:38 +0300 Subject: =?UTF-8?q?fixes=20#2558=20(SmileyAdd=20=D0=BF=D1=80=D0=BE=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=20=D0=B0=D0=B1=D1=81?= =?UTF-8?q?=D0=BE=D0=BB=D1=8E=D1=82=D0=BD=D1=8B=D0=B9=20=D0=BF=D1=83=D1=82?= =?UTF-8?q?=D1=8C=20=D0=BA=20=D1=81=D0=BC=D0=B0=D0=B9=D0=BB=D0=B0=D0=BC=20?= =?UTF-8?q?=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20=D0=BE=D1=82=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D1=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/SmileyAdd/src/download.cpp | 3 ++- plugins/SmileyAdd/src/smileys.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins/SmileyAdd/src') diff --git a/plugins/SmileyAdd/src/download.cpp b/plugins/SmileyAdd/src/download.cpp index 5b51b9970b..5834fae432 100644 --- a/plugins/SmileyAdd/src/download.cpp +++ b/plugins/SmileyAdd/src/download.cpp @@ -216,6 +216,7 @@ int FolderChanged(WPARAM, LPARAM) { FoldersGetCustomPathW(hFolderCache, g_wszCachePath, MAX_PATH, L""); FoldersGetCustomPathW(hFolderPacks, g_plugin.wszDefaultPath, MAX_PATH, L"%miranda_path%"); + size_t len = mir_wstrlen(g_plugin.wszDefaultPath); if (len && g_plugin.wszDefaultPath[len - 1] != '\\') mir_wstrcpy(g_plugin.wszDefaultPath + len, L"\\"); @@ -238,7 +239,7 @@ void DownloadInit(void) } else { wcsncpy_s(g_wszCachePath, VARSW(L"%miranda_userdata%\\SmileyCache"), _TRUNCATE); - g_plugin.wszDefaultPath[0] = 0; + wcsncpy_s(g_plugin.wszDefaultPath, VARSW(L"%miranda_path%\\"), _TRUNCATE); } g_hDlMutex = CreateMutex(nullptr, FALSE, nullptr); diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp index 12137c6657..319a05a886 100644 --- a/plugins/SmileyAdd/src/smileys.cpp +++ b/plugins/SmileyAdd/src/smileys.cpp @@ -318,7 +318,7 @@ bool SmileyPackType::LoadSmileyFile(const CMStringW &filename, const CMStringW & wchar_t wszTmp[MAX_PATH]; CMStringW modpath = VARSW(filename); if (_waccess(modpath, 4) != 0) { - PathToAbsoluteW(filename, wszTmp, g_plugin.wszDefaultPath[0] ? g_plugin.wszDefaultPath : nullptr); + PathToAbsoluteW(filename, wszTmp, g_plugin.wszDefaultPath); if (_waccess(wszTmp, 4) != 0) { if (!noerr) { static const wchar_t errmsg[] = LPGENW("Smiley pack %s for category \"%s\" not found.\nSelect correct smiley pack in the Options -> Customize -> Smileys."); @@ -331,7 +331,7 @@ bool SmileyPackType::LoadSmileyFile(const CMStringW &filename, const CMStringW & return false; } } - else PathToAbsoluteW(modpath, wszTmp, g_plugin.wszDefaultPath[0] ? g_plugin.wszDefaultPath : nullptr); + else PathToAbsoluteW(modpath, wszTmp, g_plugin.wszDefaultPath); modpath = wszTmp; m_Filename = filename; -- cgit v1.2.3