Skip to content

Commit

Permalink
LaunchServer: Make sure launching absolute symlinks works
Browse files Browse the repository at this point in the history
This was broken by 31d659d.
  • Loading branch information
gunnarbeutner authored and awesomekling committed Aug 10, 2021
1 parent 02f9ffe commit f424485
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Userland/Services/LaunchServer/Launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit f424485

Please sign in to comment.