diff options
author | Konstantin <apollo2k4@narod.ru> | 2018-05-20 21:05:22 +0300 |
---|---|---|
committer | Konstantin <apollo2k4@narod.ru> | 2018-05-20 21:05:22 +0300 |
commit | 3f90207479ee0a6530631812717801a54093658c (patch) | |
tree | 6fd49e050ec5179df59fc5badc18e5668e0d6008 /plugins/MirLua/src/mlua_script.cpp | |
parent | 7d6b89fd45814936d0edeff664bf5efb2d19b875 (diff) | |
parent | 5de8252e58fbdbebb8914e99a90bec06a0ff039f (diff) |
Merge branch 'master' of https://github.com/miranda-ng/miranda-ng
Diffstat (limited to 'plugins/MirLua/src/mlua_script.cpp')
-rw-r--r-- | plugins/MirLua/src/mlua_script.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp index 9e4cc4ffbe..976ed79688 100644 --- a/plugins/MirLua/src/mlua_script.cpp +++ b/plugins/MirLua/src/mlua_script.cpp @@ -7,15 +7,15 @@ CMLuaScript::CMLuaScript(lua_State *L, const wchar_t *path) {
mir_wstrcpy(filePath, path);
- fileName = wcsrchr(filePath, '\\') + 1;
- wchar_t *dot = wcsrchr(fileName, '.');
+ fileName = wcsrchr(filePath, L'\\') + 1;
+ const wchar_t *dot = wcsrchr(fileName, '.');
size_t length = mir_wstrlen(fileName) - mir_wstrlen(dot) + 1;
ptrW name((wchar_t*)mir_calloc(sizeof(wchar_t) * (length + 1)));
mir_wstrncpy(name, fileName, length);
- moduleName = mir_utf8encodeW(name);
+ m_szModuleName = mir_utf8encodeW(name);
}
CMLuaScript::CMLuaScript(const CMLuaScript &script)
@@ -23,13 +23,13 @@ CMLuaScript::CMLuaScript(const CMLuaScript &script) {
mir_wstrcpy(filePath, script.filePath);
fileName = mir_wstrdup(script.fileName);
- moduleName = mir_strdup(script.moduleName);
+ m_szModuleName = mir_strdup(script.m_szModuleName);
}
CMLuaScript::~CMLuaScript()
{
Unload();
- mir_free(moduleName);
+ mir_free((char*)m_szModuleName);
}
const wchar_t* CMLuaScript::GetFilePath() const
@@ -82,11 +82,11 @@ bool CMLuaScript::Load() return true;
luaL_getsubtable(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE);
- lua_getfield(L, -1, moduleName);
+ lua_getfield(L, -1, m_szModuleName);
if (!lua_toboolean(L, -1)) {
lua_pop(L, 1);
lua_pushvalue(L, -2);
- lua_setfield(L, -2, moduleName);
+ lua_setfield(L, -2, m_szModuleName);
lua_pop(L, 1);
}
else
@@ -126,7 +126,7 @@ void CMLuaScript::Unload() luaL_getsubtable(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE);
lua_pushnil(L);
- lua_setfield(L, -2, moduleName);
+ lua_setfield(L, -2, m_szModuleName);
lua_pop(L, 1);
}
|