summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-20 14:04:10 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-20 14:04:10 +0000
commite2aea7a2360da1e2ec335715e56cbd91f7fbbe41 (patch)
treecd5e2464e44f212d71fcc8d02a4ee06cfd70a378 /string.c
parent346b582c02933e1d28e94731b07bc771a83a544b (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/string.c b/string.c
index 1d7ba3a..e02fb50 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)) {