summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/diff.rb
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-09 06:24:29 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-09 06:24:29 +0200
commit667d4262e42b5866859fb9eb91a0617c1722e7a4 (patch)
treec413b95d7636ec81a3f2bd7c9e1f092958ad8186 /lib/coderay/scanners/diff.rb
parent2347f995a70d7607fc0e417c5c7323eacfdcc341 (diff)
downloadcoderay-667d4262e42b5866859fb9eb91a0617c1722e7a4.tar.gz
avoid empty tokens in Diff output, fix split_into_parts
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..8e3bf3c 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(/.+?(?=$|[\t\n\x00]| \(revision)/)
encoder.text_token match, :filename
if options[:highlight_code] && match != '/dev/null'
file_type = CodeRay::FileType.fetch(match, :text)