2 ===================================================================
3 --- cvsspam.rb (revision 255)
4 +++ cvsspam.rb (working copy)
6 addInfixSize = line.length - (prefixLen+suffixLen)
7 oversize_change = deleteInfixSize*100/@lineJustDeleted.length>33 || addInfixSize*100/line.length>33
9 - if prefixLen==1 && suffixLen==0 || deleteInfixSize<=0 || oversize_change
10 + # avoid doing 'within-a-line highlighting' if a multibyte encoding
11 + # is suspected, as all the suffix/prefix stuff above is byte, not
13 + if multibyte_encoding? || prefixLen==1 && suffixLen==0 || deleteInfixSize<=0 || oversize_change
14 print(htmlEncode(@lineJustDeleted))
16 print(htmlEncode(@lineJustDeleted[0,prefixLen]))
17 @@ -1297,6 +1300,11 @@
21 +# guess if the users selected encoding is multibyte, since some CVSspam code
22 +# isn't multibyte-safe, and needs to be disabled.
23 +def multibyte_encoding?
24 + $charset && ["utf-8", "utf-16"].include?($charset.downcase)
27 cvsroot_dir = "#{ENV['CVSROOT']}/CVSROOT"
28 $config = "#{cvsroot_dir}/cvsspam.conf"