From 3bc0e7a7caacb7fe6cc1ec0c8b3fd8a4f2e4f46e Mon Sep 17 00:00:00 2001 From: Sigmund Lahn Date: Thu, 25 May 2023 20:30:26 +0200 Subject: [PATCH] Ladybird: Look for helper processes at `{app_dir}/{helper}/{helper}` Currently, we only look at the relative path `./{helper}/{helper}`, which fails if the working directory is not the same as the directory where the ladybird binary lives. --- Ladybird/HelperProcess.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Ladybird/HelperProcess.cpp b/Ladybird/HelperProcess.cpp index 96128f259a..5c8e1bec3d 100644 --- a/Ladybird/HelperProcess.cpp +++ b/Ladybird/HelperProcess.cpp @@ -25,9 +25,12 @@ ErrorOr spawn_helper_process(StringView process_name, ReadonlySpan> get_paths_for_helper_process(StringView process_name) { + auto application_path = TRY(ak_string_from_qstring(QCoreApplication::applicationDirPath())); Vector paths; + TRY(paths.try_append(TRY(String::formatted("./{}/{}", process_name, process_name)))); - TRY(paths.try_append(TRY(String::formatted("{}/{}", TRY(ak_string_from_qstring(QCoreApplication::applicationDirPath())), process_name)))); + TRY(paths.try_append(TRY(String::formatted("{}/{}/{}", application_path, process_name, process_name)))); + TRY(paths.try_append(TRY(String::formatted("{}/{}", application_path, process_name)))); TRY(paths.try_append(TRY(String::formatted("./{}", process_name)))); // NOTE: Add platform-specific paths here return paths;