mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 02:12:08 +08:00
complete: Don't allow wrapping a command with itself
Double-fixes #5541, by not allowing it to happen.
This commit is contained in:
parent
84339d5636
commit
58b696bed1
|
@ -1656,6 +1656,11 @@ bool complete_add_wrapper(const wcstring &command, const wcstring &new_target) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// If the command and the target are the same,
|
||||
// there's no point in following the wrap-chain because we'd only complete the same thing.
|
||||
// TODO: This should maybe include full cycle detection.
|
||||
if (command == new_target) return false;
|
||||
|
||||
auto locked_map = wrapper_map.acquire();
|
||||
wrapper_map_t &wraps = *locked_map;
|
||||
wcstring_list_t *targets = &wraps[command];
|
||||
|
|
Loading…
Reference in New Issue
Block a user