From 887a050db9a0c945d06af86ca550d18f46cf176a Mon Sep 17 00:00:00 2001 From: Ryan Tomayko Date: Mon, 10 Sep 2012 01:56:08 -0700 Subject: [PATCH] Only search the first 4K chars for \r --- lib/linguist/blob_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linguist/blob_helper.rb b/lib/linguist/blob_helper.rb index de75dbc9..b0a20626 100644 --- a/lib/linguist/blob_helper.rb +++ b/lib/linguist/blob_helper.rb @@ -226,7 +226,7 @@ module Linguist # Returns true when mac format is detected. def mac_format? return if !viewable? - if pos = data.index("\r") + if pos = data[0, 4096].index("\r") data[pos + 1] != ?\n end end