summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--string.c2
-rw-r--r--version.h10
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 <usa@ruby-lang.org>
+
+ * 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 <matz@ruby-lang.org>
* 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[];