ruby-changes:25153
From: usa <ko1@a...>
Date: Tue, 16 Oct 2012 10:22:14 +0900 (JST)
Subject: [ruby-changes:25153] usa:r37205 (ruby_1_9_3): merge revision(s) 37177: [Backport #7157]
usa 2012-10-16 10:21:57 +0900 (Tue, 16 Oct 2012) New Revision: 37205 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37205 Log: merge revision(s) 37177: [Backport #7157] * ruby.c (rb_f_sub, rb_f_gsub): pass the given block. [ruby-core:47967] [Bug #7157] Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/ruby.c branches/ruby_1_9_3/test/ruby/test_rubyoptions.rb branches/ruby_1_9_3/version.h Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 37204) +++ ruby_1_9_3/ChangeLog (revision 37205) @@ -1,3 +1,8 @@ +Tue Oct 16 10:21:23 2012 Nobuyoshi Nakada <nobu@r...> + + * ruby.c (rb_f_sub, rb_f_gsub): pass the given block. + [ruby-core:47967] [Bug #7157] + Tue Oct 16 09:47:47 2012 NAKAMURA Usaku <usa@r...> * test/ruby/test_regexp.rb Index: ruby_1_9_3/version.h =================================================================== --- ruby_1_9_3/version.h (revision 37204) +++ ruby_1_9_3/version.h (revision 37205) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.3" -#define RUBY_PATCHLEVEL 291 +#define RUBY_PATCHLEVEL 292 #define RUBY_RELEASE_DATE "2012-10-16" #define RUBY_RELEASE_YEAR 2012 Index: ruby_1_9_3/ruby.c =================================================================== --- ruby_1_9_3/ruby.c (revision 37204) +++ ruby_1_9_3/ruby.c (revision 37205) @@ -1171,7 +1171,7 @@ int argc; VALUE *argv; { - VALUE str = rb_funcall3(uscore_get(), rb_intern("sub"), argc, argv); + VALUE str = rb_funcall_passing_block(uscore_get(), rb_intern("sub"), argc, argv); rb_lastline_set(str); return str; } @@ -1192,7 +1192,7 @@ int argc; VALUE *argv; { - VALUE str = rb_funcall3(uscore_get(), rb_intern("gsub"), argc, argv); + VALUE str = rb_funcall_passing_block(uscore_get(), rb_intern("gsub"), argc, argv); rb_lastline_set(str); return str; } @@ -1210,7 +1210,7 @@ static VALUE rb_f_chop(void) { - VALUE str = rb_funcall3(uscore_get(), rb_intern("chop"), 0, 0); + VALUE str = rb_funcall_passing_block(uscore_get(), rb_intern("chop"), 0, 0); rb_lastline_set(str); return str; } @@ -1232,7 +1232,7 @@ int argc; VALUE *argv; { - VALUE str = rb_funcall3(uscore_get(), rb_intern("chomp"), argc, argv); + VALUE str = rb_funcall_passing_block(uscore_get(), rb_intern("chomp"), argc, argv); rb_lastline_set(str); return str; } Index: ruby_1_9_3/test/ruby/test_rubyoptions.rb =================================================================== --- ruby_1_9_3/test/ruby/test_rubyoptions.rb (revision 37204) +++ ruby_1_9_3/test/ruby/test_rubyoptions.rb (revision 37205) @@ -553,4 +553,14 @@ assert_in_out_err(["-C", dir, a], "", [], /LoadError/, bug3851) end end + + def test_pflag_gsub + bug7157 = '[ruby-core:47967]' + assert_in_out_err(['-p', '-e', 'gsub(/t.*/){"TEST"}'], %[test], %w[TEST], [], bug7157) + end + + def test_pflag_sub + bug7157 = '[ruby-core:47967]' + assert_in_out_err(['-p', '-e', 'sub(/t.*/){"TEST"}'], %[test], %w[TEST], [], bug7157) + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/