From 05d4bbbbda3896b206006a8c2d7cd509a94ba9bd Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 6 Feb 2007 11:43:40 +0000 Subject: * string.c (rb_str_sub_bang): calling rb_str_modify() should be just before actually modifying the string. fixed: [ruby-dev:30211] (originally reported by zunda) * patchlevel 18. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@11646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ string.c | 2 +- version.h | 10 +++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 512e4daea0..8b25215400 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 6 20:41:39 2007 NAKAMURA Usaku + + * string.c (rb_str_sub_bang): calling rb_str_modify() should be just + before actually modifying the string. + fixed: [ruby-dev:30211] (originally reported by zunda) + Sat Jan 27 15:20:11 2007 Yukihiro Matsumoto * parse.y (dyna_var_lookup): should not alter dvar->val not to diff --git a/string.c b/string.c index 4651960389..58fa0362fc 100644 --- a/string.c +++ b/string.c @@ -1963,7 +1963,6 @@ rb_str_sub_bang(argc, argv, str) pat = get_pat(argv[0], 1); if (rb_reg_search(pat, str, 0, 0) >= 0) { - rb_str_modify(str); match = rb_backref_get(); regs = RMATCH(match)->regs; @@ -1979,6 +1978,7 @@ rb_str_sub_bang(argc, argv, str) else { repl = rb_reg_regsub(repl, str, regs); } + rb_str_modify(str); if (OBJ_TAINTED(repl)) tainted = 1; plen = END(0) - BEG(0); if (RSTRING(repl)->len > plen) { diff --git a/version.h b/version.h index 3e5ac0340e..5dfbf5dff5 100644 --- a/version.h +++ b/version.h @@ -1,15 +1,15 @@ #define RUBY_VERSION "1.8.5" -#define RUBY_RELEASE_DATE "2007-01-27" +#define RUBY_RELEASE_DATE "2007-02-06" #define RUBY_VERSION_CODE 185 -#define RUBY_RELEASE_CODE 20070127 -#define RUBY_PATCHLEVEL 17 +#define RUBY_RELEASE_CODE 20070206 +#define RUBY_PATCHLEVEL 18 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 #define RUBY_VERSION_TEENY 5 #define RUBY_RELEASE_YEAR 2007 -#define RUBY_RELEASE_MONTH 1 -#define RUBY_RELEASE_DAY 27 +#define RUBY_RELEASE_MONTH 2 +#define RUBY_RELEASE_DAY 6 RUBY_EXTERN const char ruby_version[]; RUBY_EXTERN const char ruby_release_date[]; -- cgit v1.2.3