From 60ea67661a53eab8159bb97c429446f6e1304995 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 28 Sep 2011 19:49:09 +0000 Subject: [PATCH] Do a better job of setting the module load path in LuaAssFile Originally committed to SVN as r5643. --- aegisub/src/auto4_lua.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/aegisub/src/auto4_lua.cpp b/aegisub/src/auto4_lua.cpp index f77fb28b4..5e62f86f9 100644 --- a/aegisub/src/auto4_lua.cpp +++ b/aegisub/src/auto4_lua.cpp @@ -209,14 +209,10 @@ namespace Automation4 { lua_pushstring(L, "path"); lua_gettable(L, -3); - wxStringTokenizer toker(lagi_wxString(OPT_GET("Path/Automation/Include")->GetString()), "|", wxTOKEN_STRTOK); - while (toker.HasMoreTokens()) { - wxFileName path(StandardPaths::DecodePath(toker.GetNextToken())); - if (path.IsOk() && !path.IsRelative() && path.DirExists()) { - wxCharBuffer p = path.GetLongPath().utf8_str(); - lua_pushfstring(L, ";%s?.lua;%s?/init.lua", p.data(), p.data()); - lua_concat(L, 2); - } + for (size_t i = 0; i < include_path.size(); ++i) { + wxCharBuffer p = include_path[i].utf8_str(); + lua_pushfstring(L, ";%s/?.lua;%s/?/init.lua", p.data(), p.data()); + lua_concat(L, 2); } lua_settable(L, -3);