From: Pat Thoyts Date: Wed, 19 Oct 2011 12:22:33 +0000 (+0100) Subject: git-gui: catch invalid or complete regular expressions and treat as no match. X-Git-Tag: gitgui-0.15.0^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b66f4f7aa750ebebbd5186e1cafeee76df4691f8;p=git.git git-gui: catch invalid or complete regular expressions and treat as no match. Signed-off-by: Pat Thoyts --- diff --git a/lib/search.tcl b/lib/search.tcl index fe165724e..db88d87c5 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 }