summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/diff.rb
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-12 16:04:51 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-12 16:04:51 +0200
commitaddcbd446066d0da1627112814e3ce1b8d404da0 (patch)
tree55a4a46e10e89afb185b014f28d4d769c0144948 /lib/coderay/scanners/diff.rb
parent7d2c3e59d1691bcde16fc3e51d92797bfc9a2442 (diff)
parent40bd2ef5d33d32c3b3987da1d115b717259819e4 (diff)
downloadcoderay-addcbd446066d0da1627112814e3ce1b8d404da0.tar.gz
Merge branch 'master' into go-scanner
Diffstat (limited to 'lib/coderay/scanners/diff.rb')
-rw-r--r--lib/coderay/scanners/diff.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/coderay/scanners/diff.rb b/lib/coderay/scanners/diff.rb
index 38efaf4..af0f755 100644
--- a/lib/coderay/scanners/diff.rb
+++ b/lib/coderay/scanners/diff.rb
@@ -45,7 +45,7 @@ module Scanners
if match = scan(/--- |\+\+\+ |=+|_+/)
encoder.begin_line line_kind = :head
encoder.text_token match, :head
- if match = scan(/.*?(?=$|[\t\n\x00]| \(revision)/)
+ if match = scan(/[^\x00\n]+?(?=$|[\t\n]| \(revision)/)
encoder.text_token match, :filename
if options[:highlight_code] && match != '/dev/null'
file_type = CodeRay::FileType.fetch(match, :text)