git-gui: catch invalid or complete regular expressions and treat as no match.
authorPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 19 Oct 2011 12:22:33 +0000 (13:22 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 19 Oct 2011 12:22:33 +0000 (13:22 +0100)
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
lib/search.tcl

index fe16572..db88d87 100644 (file)
@@ -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
 }