git-gui: catch invalid or complete regular expressions and treat as no match.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Pat Thoyts committed
Oct 19, 2011 at 13:22 UTC
b66f4f7aa750ebebbd5186e1cafeee76df4691f8
1 file changed
+9
-7
lib/search.tcl
+9
-7
@@ -133,14 +133,16 @@ method _do_search {start {mlenvar {}} {dir {}} {endbound {}}} {
133
set dir $searchdirn
134
}
135
lappend cmd $dir -- $searchstring
136
- if {$endbound ne {}} {
137
- set here [eval $cmd [list $start] [list $endbound]]
138
- } else {
139
- set here [eval $cmd [list $start]]
140
- if {$here eq {}} {
141
- set here [eval $cmd [_get_wrap_anchor $this $dir]]
136
+ if {[catch {
137
+ if {$endbound ne {}} {
138
+ set here [eval $cmd [list $start] [list $endbound]]
139
+ } else {
140
+ set here [eval $cmd [list $start]]
141
+ if {$here eq {}} {
142
+ set here [eval $cmd [_get_wrap_anchor $this $dir]]
143
+ }
144
}
143
- }
145
+ } err]} { set here {} }
146
return $here
147
}
148