mirror of https://github.com/odrling/Aegisub
Do a better job of setting the module load path in LuaAssFile
Originally committed to SVN as r5643.
This commit is contained in:
parent
8ba559b7f7
commit
60ea67661a
|
@ -209,14 +209,10 @@ namespace Automation4 {
|
||||||
lua_pushstring(L, "path");
|
lua_pushstring(L, "path");
|
||||||
lua_gettable(L, -3);
|
lua_gettable(L, -3);
|
||||||
|
|
||||||
wxStringTokenizer toker(lagi_wxString(OPT_GET("Path/Automation/Include")->GetString()), "|", wxTOKEN_STRTOK);
|
for (size_t i = 0; i < include_path.size(); ++i) {
|
||||||
while (toker.HasMoreTokens()) {
|
wxCharBuffer p = include_path[i].utf8_str();
|
||||||
wxFileName path(StandardPaths::DecodePath(toker.GetNextToken()));
|
lua_pushfstring(L, ";%s/?.lua;%s/?/init.lua", p.data(), p.data());
|
||||||
if (path.IsOk() && !path.IsRelative() && path.DirExists()) {
|
lua_concat(L, 2);
|
||||||
wxCharBuffer p = path.GetLongPath().utf8_str();
|
|
||||||
lua_pushfstring(L, ";%s?.lua;%s?/init.lua", p.data(), p.data());
|
|
||||||
lua_concat(L, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_settable(L, -3);
|
lua_settable(L, -3);
|
||||||
|
|
Loading…
Reference in New Issue