mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
LaunchServer: Make sure launching absolute symlinks works
This was broken by 31d659d
.
This commit is contained in:
parent
02f9ffeb7f
commit
f424485193
1 changed files with 3 additions and 1 deletions
|
@ -271,7 +271,9 @@ void Launcher::for_each_handler_for_path(const String& path, Function<bool(const
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (S_ISLNK(st.st_mode)) {
|
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 for_each_handler_for_path(real_path, [&](const auto& handler) -> bool {
|
||||||
return f(handler);
|
return f(handler);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue