Skip to content

Commit 2c34d0d

Browse files
committed
fix(_comp_load): pass dequoted cmd path to 3rd-party loader
1 parent a3aab5d commit 2c34d0d

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
@@ -3319,13 +3319,13 @@ _comp_load()
33193319
done
33203320
shift "$((OPTIND - 1))"
33213321
3322-
local rawcmd=$1 dir compfile
3322+
local rawcmd=$1 REPLY dir compfile
33233323
local -a paths
33243324
33253325
# Unquote the beginning backslash
3326-
local origcmd=$rawcmd
3327-
if [[ $rawcmd == \\* ]]; then
3328-
origcmd=${rawcmd:1}
3326+
_comp_dequote "$rawcmd"
3327+
local origcmd=$REPLY
3328+
if [[ $origcmd != "$rawcmd" ]]; then
33293329
# If we already have a completion for the "real" command, use it
33303330
eval -- "$(complete -p -- "$origcmd" 2>/dev/null || echo false) \"\$rawcmd\"" && return 0
33313331
fi
@@ -3334,7 +3334,7 @@ _comp_load()
33343334
[[ $cmdname ]] || return 1
33353335
33363336
# Resolve absolute path to $cmd
3337-
local REPLY cmd=$origcmd
3337+
local cmd=$origcmd
33383338
if REPLY=$(type -P -- "$cmd"); then
33393339
_comp_abspath "$REPLY"
33403340
cmd=$REPLY

0 commit comments

Comments
 (0)