From 387bbce71450a19f12dc1ac898b678c8ea5c6622 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Tue, 17 Feb 2009 02:58:28 +0000 Subject: merge revision(s) 20354: * string.c (str_independent): no independent string points null_str. [ruby-core:20082] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6@22364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ string.c | 4 +++- version.h | 8 ++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5b10b4da..95a820238 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Feb 17 11:57:39 2009 Nobuyoshi Nakada + + * string.c (str_independent): no independent string points null_str. + [ruby-core:20082] + Mon Feb 16 23:25:43 2009 Hidetoshi NAGAI * ext/tk/lib/tkextlib/blt.rb, ext/tk/lib/tkextlib/blt/vector.rb: diff --git a/string.c b/string.c index 7e01712bb..d625c542a 100644 --- a/string.c +++ b/string.c @@ -464,6 +464,8 @@ rb_str_format_m(str, arg) return rb_str_format(1, &arg, str); } +static const char null_str[] = ""; + static int str_independent(str) VALUE str; @@ -474,6 +476,7 @@ str_independent(str) if (OBJ_FROZEN(str)) rb_error_frozen("string"); if (!OBJ_TAINTED(str) && rb_safe_level() >= 4) rb_raise(rb_eSecurityError, "Insecure: can't modify string"); + if (RSTRING(str)->ptr == null_str) return 0; if (!FL_TEST(str, ELTS_SHARED)) return 1; return 0; } @@ -532,7 +535,6 @@ rb_str_associated(str) return Qfalse; } -static const char null_str[] = ""; #define make_null_str(s) do { \ FL_SET(s, ELTS_SHARED); \ RSTRING(s)->ptr = (char *)null_str; \ diff --git a/version.h b/version.h index c5528b863..3af890168 100644 --- a/version.h +++ b/version.h @@ -1,15 +1,15 @@ #define RUBY_VERSION "1.8.6" -#define RUBY_RELEASE_DATE "2009-02-16" +#define RUBY_RELEASE_DATE "2009-02-17" #define RUBY_VERSION_CODE 186 -#define RUBY_RELEASE_CODE 20090216 -#define RUBY_PATCHLEVEL 336 +#define RUBY_RELEASE_CODE 20090217 +#define RUBY_PATCHLEVEL 337 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 #define RUBY_VERSION_TEENY 6 #define RUBY_RELEASE_YEAR 2009 #define RUBY_RELEASE_MONTH 2 -#define RUBY_RELEASE_DAY 16 +#define RUBY_RELEASE_DAY 17 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; -- cgit