]> git.pld-linux.org Git - packages/cvsspam.git/blob - ruby19.patch
- ruby19 fix on users file encoding reading
[packages/cvsspam.git] / ruby19.patch
1 --- cvsspam-0.2.12/cvsspam.rb~  2010-04-07 18:25:49.252489451 +0300
2 +++ cvsspam-0.2.12/cvsspam.rb   2010-04-07 18:27:22.000000000 +0300
3 @@ -169,7 +171,7 @@
4  
5    # test to see of the given string contains non-ASCII characters
6    def requires_rfc2047?(word)
7 -    (word =~ /[\177-\377]/) != nil
8 +    (word.force_encoding('ASCII-8BIT') =~ /[\177-\377]/) != nil
9    end
10  end
11  
12 @@ -2242,6 +2244,7 @@
13    if File.exists?($users_file)
14      File.open($users_file) do |io|
15        io.each_line do |line|
16 +        line.force_encoding($users_file_charset)
17          if line =~ /^([^:]+)\s*:\s*(['"]?)([^\n\r]+)(\2)/
18            if email.address == $1
19              return EmailAddress.new($3, $users_file_charset)
This page took 0.038523 seconds and 3 git commands to generate.