Skip to content

Commit fa4b84a

Browse files
committed
Use nkf -Mq instead of pack('M') for Q-encoding
1 parent f5522a0 commit fa4b84a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

bin/commit-email.rb

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
require "optparse"
44
require "ostruct"
5+
require "nkf"
56

67
SENDMAIL = "/usr/sbin/sendmail"
78

@@ -361,12 +362,7 @@ def make_subject(name, info)
361362
subject << " (#{branches.join(', ')})" unless branches.empty?
362363
subject << ": "
363364
subject << info.log.lstrip.lines.first.to_s.strip
364-
subject_packed = [subject].pack('M').chomp
365-
if subject_packed == "#{subject}="
366-
subject
367-
else
368-
'=?utf-8?Q?' << subject_packed.gsub(/=\n/, "=?=\n =?utf-8?Q?") << '?='
369-
end
365+
NKF.nkf('-wMq', subject)
370366
end
371367

372368
def x_author(info)

0 commit comments

Comments
 (0)