diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-10 14:34:42 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-10 14:34:42 +0000 |
| commit | 353d7d98d4b25ad80e65a1ee132297cab30160bb (patch) | |
| tree | 015d5b330f130e99490d6950578d6eac458bc4fe | |
| parent | 769887ee9251bf0104c9725e87aaf1c2369a7f9f (diff) | |
| download | ruby-353d7d98d4b25ad80e65a1ee132297cab30160bb.tar.gz ruby-353d7d98d4b25ad80e65a1ee132297cab30160bb.tar.xz ruby-353d7d98d4b25ad80e65a1ee132297cab30160bb.zip | |
* re.c (rb_reg_s_quote): no longer takes optional second argument
that has never been documented.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | re.c | 25 |
2 files changed, 11 insertions, 19 deletions
@@ -1,3 +1,8 @@ +Wed Oct 10 23:32:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org> + + * re.c (rb_reg_s_quote): no longer takes optional second argument + that has never been documented. + Wed Oct 10 15:39:04 2007 Tanaka Akira <akr@fsij.org> * encoding.c (rb_enc_init): don't alias iso-8859-1 to ascii. @@ -1972,21 +1972,9 @@ rb_reg_quote(VALUE str) */ static VALUE -rb_reg_s_quote(int argc, VALUE *argv) +rb_reg_s_quote(VALUE c, VALUE str) { - VALUE str, kcode; - int kcode_saved = reg_kcode; - - rb_scan_args(argc, argv, "11", &str, &kcode); - if (!NIL_P(kcode)) { - rb_set_kcode(StringValuePtr(kcode)); - curr_kcode = reg_kcode; - reg_kcode = kcode_saved; - } - str = reg_operand(str, Qtrue); - str = rb_reg_quote(str); - kcode_reset_option(); - return str; + return rb_reg_quote(reg_operand(str, Qtrue)); } int @@ -2058,7 +2046,7 @@ rb_reg_s_union(VALUE self, VALUE args0) return v; else { VALUE args[1]; - args[0] = rb_reg_s_quote(RARRAY_LEN(args0), RARRAY_PTR(args0)); + args[0] = rb_reg_s_quote(Qnil, RARRAY_PTR(args0)[0]); return rb_class_new_instance(1, args, rb_cRegexp); } } @@ -2089,8 +2077,7 @@ rb_reg_s_union(VALUE self, VALUE args0) v = rb_reg_to_s(v); } else { - args[0] = rb_ary_entry(args0, i); - v = rb_reg_s_quote(1, args); + v = rb_reg_s_quote(Qnil, rb_ary_entry(args0, i)); } rb_str_buf_append(source, v); } @@ -2424,8 +2411,8 @@ Init_Regexp(void) rb_cRegexp = rb_define_class("Regexp", rb_cObject); rb_define_alloc_func(rb_cRegexp, rb_reg_s_alloc); rb_define_singleton_method(rb_cRegexp, "compile", rb_class_new_instance, -1); - rb_define_singleton_method(rb_cRegexp, "quote", rb_reg_s_quote, -1); - rb_define_singleton_method(rb_cRegexp, "escape", rb_reg_s_quote, -1); + rb_define_singleton_method(rb_cRegexp, "quote", rb_reg_s_quote, 1); + rb_define_singleton_method(rb_cRegexp, "escape", rb_reg_s_quote, 1); rb_define_singleton_method(rb_cRegexp, "union", rb_reg_s_union_m, -2); rb_define_singleton_method(rb_cRegexp, "last_match", rb_reg_s_last_match, -1); rb_define_singleton_method(rb_cRegexp, "try_convert", rb_reg_s_try_convert, 1); |
