From 571a0f70f39fed70b2db51e1624b2a0ee29f00c4 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 29 Nov 2023 05:14:11 +0900 Subject: [PATCH] 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. --- bash_completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 1cdb9bcc180..7089f241af2 100644 --- a/bash_completion +++ b/bash_completion @@ -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