From 3f3c55f49c4d1b496a2b0e79f4eb5bc4acb993b9 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 27 Dec 2003 18:52:03 +0000 Subject: Fix quoting of method names in regexp git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/rdoc/parsers/parse_c.rb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d290e465e6..83935a9e09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Dec 28 03:50:05 2003 Dave Thomas + + * lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::find_override_comment): + Escape method names used in regexp + Sun Dec 28 01:46:02 2003 Dave Thomas * lib/rdoc/ri/ri_formatter.rb (RI::TextFormatter::display_flow_item): diff --git a/lib/rdoc/parsers/parse_c.rb b/lib/rdoc/parsers/parse_c.rb index d28ec941e8..086a63f4de 100644 --- a/lib/rdoc/parsers/parse_c.rb +++ b/lib/rdoc/parsers/parse_c.rb @@ -360,8 +360,8 @@ module RDoc def find_override_comment(meth_name) comment = nil - puts "Override #{meth_name}" - if @body =~ %r{Document-method:\s#{meth_name}.*?\n((?>.*?\*/))}m + name = Regexp.escape(meth_name) + if @body =~ %r{Document-method:\s#{name}.*?\n((?>.*?\*/))}m comment = $1 end comment -- cgit v1.2.3