mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
Userland: Consolidate most PATH resolving into a single implementation
We previously had at least three different implementations for resolving executables in the PATH, all of which had slightly different characteristics. Merge those into a single implementation to keep the behaviour consistent, and maybe to make that implementation more configurable in the future.
This commit is contained in:
parent
39a3775f48
commit
5f99934dce
Notes:
sideshowbarker
2024-07-17 07:52:20 +09:00
Author: https://github.com/timschumi
Commit: 5f99934dce
Pull-request: https://github.com/SerenityOS/serenity/pull/14941
Reviewed-by: https://github.com/linusg
13 changed files with 74 additions and 95 deletions
|
@ -49,7 +49,7 @@ int main(int argc, char** argv, char** env)
|
|||
if (arguments[0].contains("/"sv))
|
||||
executable_path = Core::File::real_path_for(arguments[0]);
|
||||
else
|
||||
executable_path = Core::find_executable_in_path(arguments[0]);
|
||||
executable_path = Core::File::resolve_executable_from_environment(arguments[0]).value_or({});
|
||||
if (executable_path.is_empty()) {
|
||||
reportln("Cannot find executable for '{}'."sv, arguments[0]);
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue