From cafdc1620b5e57ac744064c448682bd417cabcb4 Mon Sep 17 00:00:00 2001 From: lethosor Date: Fri, 24 Jul 2020 22:15:35 -0400 Subject: [PATCH 1/2] Improve Lua listdir_recursive error handling Ref #519, #1609 --- library/LuaApi.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index c20be4618..5b731ecc7 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -2404,10 +2404,10 @@ static int filesystem_listdir_recursive(lua_State *L) luaL_checktype(L,1,LUA_TSTRING); std::string dir=lua_tostring(L,1); int depth = 10; - if (lua_type(L, 2) == LUA_TNUMBER) - depth = lua_tounsigned(L, 2); + if (lua_gettop(L) >= 2) + depth = luaL_checkint(L, 2); bool include_prefix = true; - if (lua_type(L, 3) == LUA_TBOOLEAN) + if (lua_gettop(L) >= 3) include_prefix = lua_toboolean(L, 3); std::map files; int err = DFHack::Filesystem::listdir_recursive(dir, files, depth, include_prefix); From fcb14623a71ecd796f46c97a25b06e1fba9bf0c9 Mon Sep 17 00:00:00 2001 From: lethosor Date: Fri, 24 Jul 2020 22:18:00 -0400 Subject: [PATCH 2/2] Update authors, submodules Ref dfhack/scripts#162 --- docs/Authors.rst | 1 + library/xml | 2 +- scripts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/Authors.rst b/docs/Authors.rst index 3c2777a7d..55ecbb17c 100644 --- a/docs/Authors.rst +++ b/docs/Authors.rst @@ -43,6 +43,7 @@ Deon DoctorVanGogh DoctorVanGogh Donald Ruegsegger hashaash doomchild doomchild +ElMendukol ElMendukol enjia2000 Eric Wald eswald Erik Youngren Artanis diff --git a/library/xml b/library/xml index 7822df15e..bada2199d 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 7822df15ed44ca9e68d7270329ffd54dd7744977 +Subproject commit bada2199d16bd8e97d15efee7cbe05e5eb6ee6ee diff --git a/scripts b/scripts index a5e385bb2..f028d38e4 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit a5e385bb2a3c72f878be614cb0cc004aafa17f79 +Subproject commit f028d38e4ee9d60b9295a07d23ddb8dcc5197699