mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/jcode.rb (_regexp_quote): fix quote handling.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0986c82926
commit
a3ea30352f
2 changed files with 5 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Wed Sep 5 17:41:11 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/jcode.rb (_regexp_quote): fix quote handling.
|
||||||
|
|
||||||
Mon Sep 3 20:26:08 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
|
Mon Sep 3 20:26:08 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
|
||||||
|
|
||||||
* intern.h (rb_find_file_ext): changed from rb_find_file_noext().
|
* intern.h (rb_find_file_ext): changed from rb_find_file_noext().
|
||||||
|
|
|
@ -9,9 +9,7 @@ class String
|
||||||
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
|
printf STDERR, "feel free for some warnings:\n" if $VERBOSE
|
||||||
|
|
||||||
def _regex_quote(str)
|
def _regex_quote(str)
|
||||||
str.gsub(/[][.\\|*?+{}()]/){|s|
|
str.gsub(/[][\\]/, '\\\\\&)
|
||||||
if s == "\\" then "\\\\" else "\\\\#{s}" end
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
private :_regex_quote
|
private :_regex_quote
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue