about summary refs log tree commit diff
path: root/Completion/Base/_regex_arguments
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base/_regex_arguments')
-rw-r--r--Completion/Base/_regex_arguments9
1 files changed, 5 insertions, 4 deletions
diff --git a/Completion/Base/_regex_arguments b/Completion/Base/_regex_arguments
index bbf8a2e5b..a89bb19b4 100644
--- a/Completion/Base/_regex_arguments
+++ b/Completion/Base/_regex_arguments
@@ -247,16 +247,17 @@ _ra_gen_func () {
 }
 
 _ra_gen_parse_state () {
-  local actions i
+  local actions i p
   test='if'
   for index in $=tbl[$state]; do
     if [[ "$pattern[$index]" != "[]" ]]; then
+      p="$pattern[$index]$lookahead[$index]*"
       if [[ -z "$guard[$index]" ]]; then
 	print -lr - \
-	  "$test [[ \$_ra_right = $pattern[$index]$lookahead[$index]* ]]"
+	  "$test [[ \$_ra_right = \${~:-${(qqqq)p}} ]]"
       else
 	print -lr - \
-	  "$test [[ \$_ra_right = $pattern[$index]$lookahead[$index]* ]] && {" \
+	  "$test [[ \$_ra_right = \${~:-${(qqqq)p}} ]] && {" \
 	      "$guard[$index]" \
 	    "}"
       fi
@@ -365,7 +366,7 @@ _regex_arguments () {
 
     if [[ -d "$cache_dir" && -w "$cache_dir" ]]; then
       print -lr - \
-	'if [[ $# -eq '$#' && "$*" = '"${*:q}"' ]]; then' \
+	'if [[ $# -eq '$#' && "$*" = '"${(qqqq)*}"' ]]; then' \
 	"$funcdef" \
 	'true; else false; fi' > "${cache_file}.$HOST.$$"
       source "${cache_file}.$HOST.$$" "$@"