]> git.pld-linux.org Git - packages/cvsspam.git/commitdiff
- from mailinglist
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 17 Feb 2007 16:44:32 +0000 (16:44 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    cvsspam-users_file_charset.patch -> 1.1

cvsspam-users_file_charset.patch [new file with mode: 0644]

diff --git a/cvsspam-users_file_charset.patch b/cvsspam-users_file_charset.patch
new file mode 100644 (file)
index 0000000..b255149
--- /dev/null
@@ -0,0 +1,63 @@
+Index: cvsspam.rb
+===================================================================
+--- cvsspam.rb (revision 254)
++++ cvsspam.rb (working copy)
+@@ -162,8 +162,9 @@
+   # gives a string starting "=?", and including a charset specification, that
+   # marks the start of a quoted-printable character sequence
+-  def marker_start_quoted
+-    "=?#{@charset}?#{@encoding}?"
++  def marker_start_quoted(charset=nil)
++    charset = @charset if charset.nil?
++    "=?#{charset}?#{@encoding}?"
+   end
+   # test to see of the given string contains non-ASCII characters
+@@ -1243,7 +1244,7 @@
+ # an RFC 822 email address
+ class EmailAddress
+-  def initialize(text)
++  def initialize(text, charset=nil)
+     if text =~ /^\s*([^<]+?)\s*<\s*([^>]+?)\s*>\s*$/
+       @personal_name = $1
+       @address = $2
+@@ -1251,9 +1252,10 @@
+       @personal_name = nil
+       @address = text
+     end
++    @charset=charset
+   end
+-  attr_accessor :personal_name, :address
++  attr_accessor :personal_name, :address, :charset
+   def has_personal_name?
+     return !@personal_name.nil?
+@@ -1284,7 +1286,7 @@
+   # rfc2047 encode the word, if it contains non-ASCII characters
+   def encode_word(word)
+     if $encoder.requires_rfc2047?(word)
+-      encoded = $encoder.marker_start_quoted
++      encoded = $encoder.marker_start_quoted(@charset)
+       $encoder.each_char_encoded(word) do |code|
+       encoded << code
+       end
+@@ -1299,6 +1301,7 @@
+ cvsroot_dir = "#{ENV['CVSROOT']}/CVSROOT"
+ $config = "#{cvsroot_dir}/cvsspam.conf"
+ $users_file = "#{cvsroot_dir}/users"
++$users_file_charset = nil
+ $debug = false
+ $recipients = Array.new
+@@ -1762,7 +1765,7 @@
+       io.each_line do |line|
+         if line =~ /^([^:]+)\s*:\s*(['"]?)([^\n\r]+)(\2)/
+           if email.address == $1
+-            return EmailAddress.new($3)
++            return EmailAddress.new($3, $users_file_charset)
+           end
+         end
+       end
This page took 0.072642 seconds and 4 git commands to generate.