diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-12-25 22:14:44 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-12-25 22:14:44 +0000 |
commit | 44cebe183fc13d6ced4c2eed155aa03909a542f4 (patch) | |
tree | 21ce22a23ea79e0a1269f6082ab91f9525056437 /plugins/MirLua/src/m_icolib.cpp | |
parent | 64cf90e84966b56fa3da9d01babd0387f23c8086 (diff) |
MirLua: minor fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15942 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_icolib.cpp')
-rw-r--r-- | plugins/MirLua/src/m_icolib.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/MirLua/src/m_icolib.cpp b/plugins/MirLua/src/m_icolib.cpp index 733fab90e0..eea44838d4 100644 --- a/plugins/MirLua/src/m_icolib.cpp +++ b/plugins/MirLua/src/m_icolib.cpp @@ -5,9 +5,13 @@ static int lua_AddIcon(lua_State *L) const char *name = luaL_checkstring(L, 1);
ptrT description(mir_utf8decodeT(luaL_checkstring(L, 2)));
ptrT section(mir_utf8decodeT(luaL_optstring(L, 3, MODULE)));
+ ptrT filePath(mir_utf8decodeT(lua_tostring(L, 4)));
- TCHAR filePath[MAX_PATH];
- GetModuleFileName(g_hInstance, filePath, _countof(filePath));
+ if (filePath == NULL)
+ {
+ filePath = (TCHAR*)mir_calloc(MAX_PATH + 1);
+ GetModuleFileName(g_hInstance, filePath, MAX_PATH);
+ }
SKINICONDESC si = { 0 };
si.flags = SIDF_ALL_TCHAR;
|