From 6e62f9e46161fa143a962c3f00fad3fcc79d43ed Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 4 May 2013 18:31:33 -0700 Subject: [PATCH] Pass the filename to moonscript.loadstring for error reporting --- aegisub/src/auto4_lua_scriptreader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aegisub/src/auto4_lua_scriptreader.cpp b/aegisub/src/auto4_lua_scriptreader.cpp index a588cd7ea..a5e92074a 100644 --- a/aegisub/src/auto4_lua_scriptreader.cpp +++ b/aegisub/src/auto4_lua_scriptreader.cpp @@ -57,6 +57,7 @@ namespace Automation4 { if (luaL_dostring(L, "return require('moonscript').loadstring")) return false; // Leaves error message on stack lua_pushlstring(L, &buff[0], buff.size()); - return lua_pcall(L, 1, 1, 0) == 0; // Leaves script or error message on stack + lua_pushstring(L, filename.string().c_str()); + return lua_pcall(L, 2, 1, 0) == 0; // Leaves script or error message on stack } }