diff --git a/src/script/cpp_api/s_security.cpp b/src/script/cpp_api/s_security.cpp index 0d3209985..b23e94cd2 100644 --- a/src/script/cpp_api/s_security.cpp +++ b/src/script/cpp_api/s_security.cpp @@ -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())