提交 a1638748 编写于 作者: S Shinya Maeda

put force_encoding in def reverse_line

上级 22f1d2a1
......@@ -74,7 +74,7 @@ module Gitlab
match = ""
reverse_line do |line|
matches = line.force_encoding(regex.encoding).scan(regex)
matches = line.scan(regex)
next unless matches.is_a?(Array)
next if matches.empty?
......@@ -108,11 +108,11 @@ module Gitlab
buf = stream.read(read_size) + debris
debris, *lines = buf.each_line.to_a
lines.reverse_each do |line|
yield(line)
yield(line.force_encoding('UTF-8'))
end
end
yield(debris)
yield(debris.force_encoding('UTF-8'))
end
def calc_read_size(pos, max)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册