rdoc/rdoc — pull request #146 by pioz (2012-09-18 00:20:51+00:00)
Title: Bug on regex inside the find_class_comment method (c.rb)

If we have a file like this:

/*
* Comment 1
*/
foo = rb_define_class ("MyClassName1", rb_cObject);

/*
* Comment 2
*/
bar = rb_define_class ("MyClassName2", rb_cObject);

RDoc assigns the `Comment 1` for both classes `MyClassName1` and `MyClassName2`.
Currently the `.*?` after `rb_define_(class|module)` in your regex is causing you to always match and capture the first part of the string, and the `.*?` matches up until the class name you are actually looking for.

This pull request fix this problem adding a greedy match at the beginning of the regex to make sure that you only start your capture group at the last `/*` before the class name you want.