From 5a2465db313df5f50cf7e4945afa70cc93322718 Mon Sep 17 00:00:00 2001 From: eban Date: Sat, 20 Nov 2004 14:04:10 +0000 Subject: * test/ruby/test_stringchar.rb (test_bang): added. * string.c (rb_str_upcase_bang, rb_str_capitalize_bang) (rb_str_swapcase_bang): missing rb_str_modify(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index 1d7ba3aa6..e02fb504b 100644 --- a/string.c +++ b/string.c @@ -2725,6 +2725,7 @@ rb_str_upcase_bang(str) char *s, *send; int modify = 0; + rb_str_modify(str); s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; while (s < send) { if (ismbchar(*s)) { @@ -2838,6 +2839,7 @@ rb_str_capitalize_bang(str) char *s, *send; int modify = 0; + rb_str_modify(str); if (RSTRING(str)->len == 0 || !RSTRING(str)->ptr) return Qnil; s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; if (ISLOWER(*s)) { @@ -2895,6 +2897,7 @@ rb_str_swapcase_bang(str) char *s, *send; int modify = 0; + rb_str_modify(str); s = RSTRING(str)->ptr; send = s + RSTRING(str)->len; while (s < send) { if (ismbchar(*s)) { -- cgit