Only search the first 4K chars for \r

This commit is contained in:
Ryan Tomayko
2012-09-10 01:56:08 -07:00
parent bda895eaae
commit 887a050db9

View File

@@ -226,7 +226,7 @@ module Linguist
# Returns true when mac format is detected. # Returns true when mac format is detected.
def mac_format? def mac_format?
return if !viewable? return if !viewable?
if pos = data.index("\r") if pos = data[0, 4096].index("\r")
data[pos + 1] != ?\n data[pos + 1] != ?\n
end end
end end