mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Kill mac_format check, buggy
This commit is contained in:
@@ -247,25 +247,6 @@ module Linguist
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Character used to split lines. This is almost always "\n" except when Mac
|
|
||||||
# Format is detected in which case it's "\r".
|
|
||||||
#
|
|
||||||
# Returns a split pattern string.
|
|
||||||
def line_split_character
|
|
||||||
@line_split_character ||= (mac_format?? "\r" : "\n")
|
|
||||||
end
|
|
||||||
|
|
||||||
# Private: Is the data in ** Mac Format **. This format uses \r (0x0d) characters
|
|
||||||
# for line ends and does not include a \n (0x0a).
|
|
||||||
#
|
|
||||||
# Returns true when mac format is detected.
|
|
||||||
def mac_format?
|
|
||||||
return if !viewable?
|
|
||||||
if pos = data[0, 4096].index("\r")
|
|
||||||
data[pos + 1] != ?\n
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Public: Get number of lines of code
|
# Public: Get number of lines of code
|
||||||
#
|
#
|
||||||
# Requires Blob#data
|
# Requires Blob#data
|
||||||
|
|||||||
Reference in New Issue
Block a user