From 24050ebc2c1b40acec39ebf951f0c31ebc421b88 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Mon, 10 Nov 2014 17:07:37 -0500 Subject: [PATCH] Fix segfault when dofile() called within _premake_main() --- src/host/lua_auxlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/host/lua_auxlib.c b/src/host/lua_auxlib.c index f2807713..84b91a63 100644 --- a/src/host/lua_auxlib.c +++ b/src/host/lua_auxlib.c @@ -49,7 +49,7 @@ LUALIB_API int luaL_loadfile (lua_State* L, const char* filename) const char* script_dir; lua_getglobal(L, "_SCRIPT_DIR"); script_dir = lua_tostring(L, -1); - if (script_dir[0] == '$') { + if (script_dir && script_dir[0] == '$') { /* call path.getabsolute() to handle ".." if present */ lua_pushcfunction(L, path_getabsolute); lua_pushstring(L, filename);