[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 9f49a101174911d8672c55cdc379ac5a3db186ff

Ville Skyttä ville.skytta at iki.fi
Sat Jan 9 10:58:24 UTC 2010


The following commit has been merged in the master branch:
commit 9f49a101174911d8672c55cdc379ac5a3db186ff
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Jan 9 12:46:49 2010 +0200

    (testsuite) Escape more regexp metacharacters.

diff --git a/test/lib/library.exp b/test/lib/library.exp
index ecea3dd..fe8d7e2 100644
--- a/test/lib/library.exp
+++ b/test/lib/library.exp
@@ -221,7 +221,7 @@ proc assert_complete_any {cmd {test ""} {prompt /@}} {
     send "$cmd\t"
     expect -ex "$cmd"
         # Escape special regexp characters
-    regsub -all {([\[\]\(\)\.\\\+])} $cmd {\\\1} cmd
+    regsub -all {([\^$+*?.|(){}[\]\\])} $cmd {\\\1} cmd
     expect {
         -timeout 1
         # Match completions, multiple words
@@ -506,8 +506,8 @@ proc match_items {items test {prompt /@} {size 20}} {
         set expected ""
         for {set j 0} {$j < $size && $i + $j < [llength $items]} {incr j} {
             set item "[lindex $items [expr {$i + $j}]]"
-                # Escape special regexp characters ([]().\*^$)
-            regsub -all {([\[\]\(\)\.\\\+\*\^\$])} $item {\\\1} item
+                # Escape special regexp characters
+            regsub -all {([\^$+*?.|(){}[\]\\])} $item {\\\1} item
             append expected $item
             if {[llength $items] > 1} {append expected {\s+}};
         }; # for

-- 
bash-completion



More information about the Bash-completion-commits mailing list