diff --git a/apps/twnlua/game.c b/apps/twnlua/game.c index 10b16aa..f84ceaa 100644 --- a/apps/twnlua/game.c +++ b/apps/twnlua/game.c @@ -25,6 +25,12 @@ void bindgen_upload_context(lua_State *L); static int physfs_loader(lua_State *L) { const char *name = luaL_checkstring(L, 1); + static const char *name_breaker = NULL; + if (name_breaker && SDL_strcmp(name, name_breaker) == 0) { + log_critical("Recursive load on itself from lua module (%s)", name_breaker); + return 0; + } name_breaker = name; + /* replace dots with path slashes */ char *path_copy = SDL_strdup(name); char *ch = NULL;