1Based on this:
2http://sourceforge.net/tracker/?func=detail&aid=1493886&group_id=5152&atid=305152
3fix the infinite loops in quote highlight - ID: 1493886
4
5--- cbrowser-0.8-2/ftcllib.tcl 2000-07-04 01:17:43.000000000 +0200
6+++ cbrowser-0.8/ftcllib.tcl 2006-05-24 00:39:18.833762522 +0200
7@@ -1290,13 +1290,39 @@
8 foreach {start end} [concat 1.0 [$widget tag ranges comment] end] {
9
10 while {[set temp [$widget search -regexp -- $pattern $start $end]] != ""} {
11+ set startquote [$widget index "$temp + 1chars"]
12
13- set endquote [$widget search -regexp -- {[^\\]\"} "$temp + 1chars" $end]
14+ set temp [$widget index "$startquote + 1chars"]
15+ while {1==1} {
16+ set endquote [$widget search -regexp -- {\"} $temp $end]
17+
18+ # The program will not break if a /*C comment*/ is between C quotes.
19+ if { $endquote == "" } {
20+ set endquote $startquote
21+ break
22+ }
23+
24+ # look for double backslashes
25+ if {[set temp2 [$widget search -regexp -- {\\\\} $temp $endquote]] != ""} {
26+ set temp "$temp2 + 2chars"
27+ continue
28+ }
29+
30+ # look for \"
31+ if {[set temp2 [$widget search -regexp -- {\\\"} $temp $endquote]] != ""} {
32+ set temp "$temp2 + 2chars"
33+ continue
34+ }
35+
36+ break
37+ }
38
39 if {[strlen $endquote] > 0} {
40- set start [$widget index "$endquote + 2chars"]
41+ set start [$widget index "$endquote + 1chars"]
42
43- $widget tag add quote "$temp + 1chars" $start
44+ $widget tag add quote $startquote $start
45+ } else {
46+ set start [$widget index "$start + 1chars"]
47 }
48 }
49 }