Fix ScriptApiSecurity::checkPath mangling non-existent paths

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

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