Skip to content

Commit 571a0f7

Browse files
committed
fix(_comp_delimited): treat delimiter as a fixed string
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.
1 parent da16bf6 commit 571a0f7

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
@@ -1199,7 +1199,7 @@ _comp_delimited()
11991199
delimiter=$1
12001200
shift
12011201
fi
1202-
[[ $cur == *$delimiter* ]] && prefix=${cur%"$delimiter"*}$delimiter
1202+
[[ $cur == *"$delimiter"* ]] && prefix=${cur%"$delimiter"*}$delimiter
12031203

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

0 commit comments

Comments
 (0)