Commit d0d0302f d0d0302f9ab0c44a95e298742d1e7bf410212a2b by Sergey Poznyakoff

Properly handle --re and -- flags.

1 parent 6aeb6636
...@@ -216,8 +216,21 @@ proc imap4d_test { args } { ...@@ -216,8 +216,21 @@ proc imap4d_test { args } {
216 set len [expr [llength $args] - 1] 216 set len [expr [llength $args] - 1]
217 217
218 if {$len >= 2} { 218 if {$len >= 2} {
219 set regexp 0
219 for {set i 1} {$i <= [expr $len - 1]} {incr i} { 220 for {set i 1} {$i <= [expr $len - 1]} {incr i} {
220 set pattern [concat $pattern [list "* [lindex $args $i]"]] 221 switch -regexp -- "[lindex $args $i]" {
222 -re.*$ -
223 -- { set item "[lindex $args $i]"; set regexp 1 }
224 default { if {$regexp} {
225 set item "\\* [lindex $args $i]"
226 } else {
227 set item "* [lindex $args $i]"
228 }
229 set regexp 0
230 }
231 }
232
233 set pattern [concat $pattern [list $item]]
221 } 234 }
222 set tagged [lindex $args end] 235 set tagged [lindex $args end]
223 } elseif {$len == 1} { 236 } elseif {$len == 1} {
......