ruby-changes:2180
From: ko1@a...
Date: 10 Oct 2007 23:35:02 +0900
Subject: [ruby-changes:2180] matz - Ruby:r13671 (trunk): * re.c (rb_reg_s_quote): no longer takes optional second argument
matz 2007-10-10 23:34:42 +0900 (Wed, 10 Oct 2007) New Revision: 13671 Modified files: trunk/ChangeLog trunk/re.c Log: * re.c (rb_reg_s_quote): no longer takes optional second argument that has never been documented. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13671&r2=13670 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/re.c?r1=13671&r2=13670 Index: re.c =================================================================== --- re.c (revision 13670) +++ re.c (revision 13671) @@ -1972,21 +1972,9 @@ */ 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 @@ 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 @@ 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 @@ 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); Index: ChangeLog =================================================================== --- ChangeLog (revision 13670) +++ ChangeLog (revision 13671) @@ -1,3 +1,8 @@ +Wed Oct 10 23:32:15 2007 Yukihiro Matsumoto <matz@r...> + + * 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@f...> * encoding.c (rb_enc_init): don't alias iso-8859-1 to ascii. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml