Fix ScriptApiSecurity::checkPath mangling non-existent paths

bug introduced in 1c1c97cbd1
This commit is contained in:
sfan5 2024-11-03 19:27:08 +01:00
parent 9982c56373
commit 294a30e445

View file

@ -555,7 +555,7 @@ bool ScriptApiSecurity::checkPath(lua_State *L, const char *path,
// by the operating system anyways. // by the operating system anyways.
return false; return false;
} }
removed.append(component).append(removed.empty() ? "" : DIR_DELIM + removed); removed = component + (removed.empty() ? "" : DIR_DELIM + removed);
abs_path = fs::AbsolutePath(cur_path); abs_path = fs::AbsolutePath(cur_path);
} }
if (abs_path.empty()) if (abs_path.empty())