Skip to content

Commit 03bdac4

Browse files
scopakinomyoga
andauthored
perf(__load_completion): avoid a subshell on completion install check
#924 (comment) Co-authored-by: Koichi Murase <[email protected]>
1 parent a44ba64 commit 03bdac4

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
@@ -2592,7 +2592,7 @@ __load_completion()
25922592
return 0
25932593
fi
25942594
# If not, see if we got one for $cmdname
2595-
if compspec=$(complete -p "$cmdname" 2>/dev/null); then
2595+
if [[ $cmdname != "$cmd" ]] && compspec=$(complete -p "$cmdname" 2>/dev/null); then
25962596
# Use that for $cmd too, if we have a full path to it
25972597
[[ $cmd == /* ]] && $compspec "$cmd"
25982598
return 0

0 commit comments

Comments
 (0)