Skip to content

Commit 7ed6f6c

Browse files
committed
fix(_comp_load): pass dequoted cmd path to 3rd-party loader
1 parent f7d0557 commit 7ed6f6c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bash_completion

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3250,13 +3250,13 @@ _comp_load()
32503250
done
32513251
shift "$((OPTIND - 1))"
32523252
3253-
local rawcmd=$1 dir compfile
3253+
local rawcmd=$1 REPLY dir compfile
32543254
local -a paths
32553255
32563256
# Unquote the beginning backslash
3257-
local origcmd=$rawcmd
3258-
if [[ $rawcmd == \\* ]]; then
3259-
origcmd=${rawcmd:1}
3257+
_comp_dequote "$rawcmd"
3258+
local origcmd=$REPLY
3259+
if [[ $origcmd != "$rawcmd" ]]; then
32603260
# If we already have a completion for the "real" command, use it
32613261
eval -- "$(complete -p -- "$origcmd" 2>/dev/null || echo false) \"\$rawcmd\"" && return 0
32623262
fi
@@ -3265,7 +3265,7 @@ _comp_load()
32653265
[[ $cmdname ]] || return 1
32663266
32673267
# Resolve absolute path to $cmd
3268-
local REPLY cmd=$origcmd
3268+
local cmd=$origcmd
32693269
if REPLY=$(type -P -- "$cmd"); then
32703270
_comp_abspath "$REPLY"
32713271
cmd=$REPLY

0 commit comments

Comments
 (0)