summaryrefslogtreecommitdiff
path: root/lib/search.tcl
diff options
context:
space:
mode:
authorLibravatar Pat Thoyts <patthoyts@users.sourceforge.net>2011-10-19 13:22:33 +0100
committerLibravatar Pat Thoyts <patthoyts@users.sourceforge.net>2011-10-19 13:22:33 +0100
commitb66f4f7aa750ebebbd5186e1cafeee76df4691f8 (patch)
tree0ad9cfc502dbac54cf786d5ca61b65a4665c3280 /lib/search.tcl
parentgit-gui: theme the search and line-number entry fields on blame screen (diff)
downloadtgif-b66f4f7aa750ebebbd5186e1cafeee76df4691f8.tar.xz
git-gui: catch invalid or complete regular expressions and treat as no match.
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Diffstat (limited to 'lib/search.tcl')
-rw-r--r--lib/search.tcl16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/search.tcl b/lib/search.tcl
index fe165724ed..db88d87c51 100644
--- a/lib/search.tcl
+++ b/lib/search.tcl
@@ -133,14 +133,16 @@ method _do_search {start {mlenvar {}} {dir {}} {endbound {}}} {
set dir $searchdirn
}
lappend cmd $dir -- $searchstring
- if {$endbound ne {}} {
- set here [eval $cmd [list $start] [list $endbound]]
- } else {
- set here [eval $cmd [list $start]]
- if {$here eq {}} {
- set here [eval $cmd [_get_wrap_anchor $this $dir]]
+ if {[catch {
+ if {$endbound ne {}} {
+ set here [eval $cmd [list $start] [list $endbound]]
+ } else {
+ set here [eval $cmd [list $start]]
+ if {$here eq {}} {
+ set here [eval $cmd [_get_wrap_anchor $this $dir]]
+ }
}
- }
+ } err]} { set here {} }
return $here
}