mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-28 20:55:11 +00:00
path: Don't try to find empty commands
This would e.g. cause highlighting to be broken if you added an executable file to $PATH
This commit is contained in:
parent
cfecc4cc35
commit
787ba6d951
1 changed files with 4 additions and 0 deletions
|
@ -43,6 +43,10 @@ static get_path_result_t path_get_path_core(const wcstring &cmd, const wcstring_
|
||||||
return S_ISREG(buff.st_mode) ? 0 : EACCES;
|
return S_ISREG(buff.st_mode) ? 0 : EACCES;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (cmd.empty()) {
|
||||||
|
return noent_res;
|
||||||
|
}
|
||||||
|
|
||||||
// Commands cannot contain NUL byte.
|
// Commands cannot contain NUL byte.
|
||||||
if (cmd.find(L'\0') != wcstring::npos) {
|
if (cmd.find(L'\0') != wcstring::npos) {
|
||||||
return noent_res;
|
return noent_res;
|
||||||
|
|
Loading…
Reference in a new issue