mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 21:03:12 +00:00
lint: redundant if statement
This commit is contained in:
parent
b7d910a941
commit
4e505efc50
1 changed files with 2 additions and 9 deletions
|
@ -337,17 +337,10 @@ bool autosuggest_validate_from_history(const history_item_t &item,
|
||||||
handled = true;
|
handled = true;
|
||||||
bool is_help =
|
bool is_help =
|
||||||
string_prefixes_string(dir, L"--help") || string_prefixes_string(dir, L"-h");
|
string_prefixes_string(dir, L"--help") || string_prefixes_string(dir, L"-h");
|
||||||
if (is_help) {
|
if (!is_help) {
|
||||||
suggestionOK = false;
|
|
||||||
} else {
|
|
||||||
wcstring path;
|
wcstring path;
|
||||||
bool can_cd = path_get_cdpath(dir, &path, working_directory.c_str(), vars);
|
bool can_cd = path_get_cdpath(dir, &path, working_directory.c_str(), vars);
|
||||||
if (!can_cd) {
|
if (can_cd && !paths_are_same_file(working_directory, path)) {
|
||||||
suggestionOK = false;
|
|
||||||
} else if (paths_are_same_file(working_directory, path)) {
|
|
||||||
// Don't suggest the working directory as the path!
|
|
||||||
suggestionOK = false;
|
|
||||||
} else {
|
|
||||||
suggestionOK = true;
|
suggestionOK = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue