Skip to content

Commit

Permalink
fix(_comp_delimited): treat delimiter as a fixed string
Browse files Browse the repository at this point in the history
The right-hand side of == in the conditional commands [[ ]] are
treated as a glob pattern.  In the other occurrences of $delimiter,
they are quoted as "$delimiter", which means that $delimiter treated
as a fixed string.  However, only in this line, $delimiter is treated
as a glob pattern.  In this patch, we quote it properly the same as in
the other occurrences of $delimiter.
  • Loading branch information
akinomyoga committed Nov 28, 2023
1 parent da16bf6 commit 571a0f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ _comp_delimited()
delimiter=$1
shift
fi
[[ $cur == *$delimiter* ]] && prefix=${cur%"$delimiter"*}$delimiter
[[ $cur == *"$delimiter"* ]] && prefix=${cur%"$delimiter"*}$delimiter

if [[ $deduplicate ]]; then
# We could construct a -X pattern to feed to compgen, but that'd
Expand Down

0 comments on commit 571a0f7

Please sign in to comment.