mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:07:45 +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
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue