Skip to content

Commit

Permalink
Merge pull request #56 from Wires77/fix_folder_delete
Browse files Browse the repository at this point in the history
Properly handle returned value for RemoveDir
  • Loading branch information
Wires77 authored Apr 10, 2024
2 parents 4f70049 + f9a3a4d commit b9118e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ static int l_RemoveDir(lua_State* L)
ui->LAssert(L, lua_isstring(L, 1), "l_RemoveDir() argument 1: expected string, got %s", luaL_typename(L, 1));
std::filesystem::path path(lua_tostring(L, 1));
std::error_code ec;
if (!is_directory(path, ec) || ec || remove(path, ec) || ec) {
if (!is_directory(path, ec) || ec || !remove(path, ec) || ec) {
lua_pushnil(L);
lua_pushstring(L, strerror(ec.value()));
return 2;
Expand Down

0 comments on commit b9118e2

Please sign in to comment.