1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:17:34 +00:00

LaunchServer: Make sure launching absolute symlinks works

This was broken by 31d659d.
This commit is contained in:
Gunnar Beutner 2021-08-10 19:35:26 +02:00 committed by Andreas Kling
parent 02f9ffeb7f
commit f424485193

View file

@ -271,7 +271,9 @@ void Launcher::for_each_handler_for_path(const String& path, Function<bool(const
return;
if (S_ISLNK(st.st_mode)) {
auto real_path = Core::File::real_path_for(String::formatted("{}/{}", LexicalPath::dirname(path), Core::File::read_link(path)));
auto link_target = LexicalPath { Core::File::read_link(path) };
LexicalPath absolute_link_target = link_target.is_absolute() ? link_target : LexicalPath::join(LexicalPath::dirname(path), link_target.string());
auto real_path = Core::File::real_path_for(absolute_link_target.string());
return for_each_handler_for_path(real_path, [&](const auto& handler) -> bool {
return f(handler);
});