Skip to content

Commit ee808bc

Browse files
committed
Remove needless backtracking
This caused ruby 1.8.7 to have an overflow in the regular expression matcher as it continually tried to backtrack on uncaptured content. Fixes #327
1 parent 56fe6eb commit ee808bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rdoc/parser/c.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,10 +745,10 @@ def find_class_comment class_name, class_mod
745745
elsif @content =~ %r%Document-(?:class|module):\s+#{class_name}\s*?
746746
(?:<\s+[:,\w]+)?\n((?>.*?\*/))%xm then
747747
comment = "/*\n#{$1}"
748-
elsif @content =~ %r%.*((?>/\*.*?\*/\s+))
748+
elsif @content =~ %r%((?>/\*.*?\*/\s+))
749749
([\w\.\s]+\s* = \s+)?rb_define_(class|module).*?"(#{class_name})"%xm then
750750
comment = $1
751-
elsif @content =~ %r%.*((?>/\*.*?\*/\s+))
751+
elsif @content =~ %r%((?>/\*.*?\*/\s+))
752752
([\w\.\s]+\s* = \s+)?rb_define_(class|module)_under.*?"(#{class_name.split('::').last})"%xm then
753753
comment = $1
754754
else

0 commit comments

Comments
 (0)