Skip to content

Commit 42d8269

Browse files
committed
fix(__load_completion): check _comp_realcommand return code
1 parent ed01af3 commit 42d8269

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

bash_completion

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,8 +2525,7 @@ __load_completion()
25252525
25262526
# 3) From bin directories extracted from $(realpath "$cmd") and PATH
25272527
local ret
2528-
_comp_realcommand "$1"
2529-
paths=("${ret%/*}")
2528+
_comp_realcommand "$1" && paths=("${ret%/*}") || paths=()
25302529
_comp_split -aF : paths "$PATH"
25312530
for dir in "${paths[@]%/}"; do
25322531
if [[ -d $dir && $dir == ?*/@(bin|sbin) ]]; then

0 commit comments

Comments
 (0)