Skip to content

Commit b9118e2

Browse files
authored
Merge pull request #56 from Wires77/fix_folder_delete
Properly handle returned value for RemoveDir
2 parents 4f70049 + f9a3a4d commit b9118e2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ui_api.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ static int l_RemoveDir(lua_State* L)
11061106
ui->LAssert(L, lua_isstring(L, 1), "l_RemoveDir() argument 1: expected string, got %s", luaL_typename(L, 1));
11071107
std::filesystem::path path(lua_tostring(L, 1));
11081108
std::error_code ec;
1109-
if (!is_directory(path, ec) || ec || remove(path, ec) || ec) {
1109+
if (!is_directory(path, ec) || ec || !remove(path, ec) || ec) {
11101110
lua_pushnil(L);
11111111
lua_pushstring(L, strerror(ec.value()));
11121112
return 2;

0 commit comments

Comments
 (0)