Test blank file

This commit is contained in:
Joshua Peek
2011-06-28 09:26:35 -05:00
parent 0576f1742f
commit 58e99aa5aa
3 changed files with 2 additions and 1 deletions

View File

@@ -308,7 +308,7 @@ module Linguist
# Fail fast if blob isn't viewable?
return unless viewable?
if data && (match = lines[0].match(/(.+)\n?/)) && (bang = match[0]) =~ /^#!/
if lines.any? && (match = lines[0].match(/(.+)\n?/)) && (bang = match[0]) =~ /^#!/
bang.sub!(/^#! /, '#!')
tokens = bang.split(' ')
pieces = tokens.first.split('/')