mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibCore: Handle resolving executable paths even when PATH is null
This fixes a crash when trying to run `Escalator Terminal` from Run
This commit is contained in:
parent
892a3e7d12
commit
71359ee453
Notes:
sideshowbarker
2024-07-17 06:35:16 +09:00
Author: https://github.com/meiskam 🔰 Commit: https://github.com/SerenityOS/serenity/commit/71359ee453 Pull-request: https://github.com/SerenityOS/serenity/pull/15900 Reviewed-by: https://github.com/trflynn89 ✅
|
@ -572,8 +572,9 @@ Optional<String> File::resolve_executable_from_environment(StringView filename)
|
|||
}
|
||||
|
||||
auto const* path_str = getenv("PATH");
|
||||
StringView path { path_str, strlen(path_str) };
|
||||
|
||||
StringView path;
|
||||
if (path_str)
|
||||
path = { path_str, strlen(path_str) };
|
||||
if (path.is_empty())
|
||||
path = DEFAULT_PATH_SV;
|
||||
|
||||
|
|
Loading…
Reference in a new issue