Skip to content

Commit e01c4a1

Browse files
committed
fix(__load_completion): pass full path to fallback completion loaders
Passing just the basename results in failures when a command invoked (with a path) is not in `$PATH`. Also facilitates correct command instance being used to generate the completion in our fallback completion loaders. Completions generated by different instances of the command might vary.
1 parent f6a2211 commit e01c4a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bash_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2576,7 +2576,7 @@ __load_completion()
25762576
# Do not warn with . or .. (especially the former is common)
25772577
[[ $compfile == */.?(.) ]] ||
25782578
echo "bash_completion: $compfile: is a directory" >&2
2579-
elif [[ -e $compfile ]] && . "$compfile" "$cmdname"; then
2579+
elif [[ -e $compfile ]] && . "$compfile" "$cmd" "$@"; then
25802580
[[ $backslash ]] && $(complete -p "$cmdname") "\\$cmdname"
25812581
return 0
25822582
fi

0 commit comments

Comments
 (0)