summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/SmileyAdd/src/download.cpp3
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp4
2 files changed, 4 insertions, 3 deletions
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;