diff options
author | George Hazan <ghazan@miranda.im> | 2020-08-31 18:55:38 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-08-31 18:55:38 +0300 |
commit | 04422a4866cbc64659a70ce3759ccccb73b69dda (patch) | |
tree | 7681da23ec3ac33eab4b7b221f3feafa91c0ed6e | |
parent | 7650b1b0aa057df686e7d44bae58eaeba03b9b93 (diff) |
fixes #2558 (SmileyAdd прописывает абсолютный путь к смайлам вместо относительных)
-rw-r--r-- | plugins/SmileyAdd/src/download.cpp | 3 | ||||
-rw-r--r-- | plugins/SmileyAdd/src/smileys.cpp | 4 |
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; |