Skip to content

Commit f9a3a4d

Browse files
committed
Properly handle returned value for RemoveDir
1 parent 4f70049 commit f9a3a4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ui_api.cpp

Lines changed: 1 addition & 1 deletion
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)