summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-30 09:32:56 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-30 09:32:56 +0000
commit1dd17757b547dbc056faa42e13fd3e1fd711a608 (patch)
treea5be8dbddace6615325aa7034305eea807ff6086 /string.c
parent1234770ca21f8bd9586b6c932fdb2cd2b0b2271b (diff)
gw32 b19 patch
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/string.c b/string.c
index e60088fd88..59e4024bbf 100644
--- a/string.c
+++ b/string.c
@@ -1610,8 +1610,10 @@ str_capitalize_bang(str)
str_modify(str);
s = RSTRING(str)->ptr; send = s + RSTRING(str)->len;
- if (islower(*s))
+ if (islower(*s)) {
*s = toupper(*s);
+ modify = 1;
+ }
while (++s < send) {
if (ismbchar(*s)) {
s++;
@@ -1867,10 +1869,10 @@ str_delete_bang(str1, str2)
s = t = RSTRING(str1)->ptr;
send = s + RSTRING(str1)->len;
while (s < send) {
- if (!squeez[*s & 0xff]) {
- *t++ = *s;
+ if (squeez[*s & 0xff])
modify = 1;
- }
+ else
+ *t++ = *s;
s++;
}
*t = '\0';
@@ -2469,7 +2471,7 @@ str_intern(str)
ID id;
if (strlen(RSTRING(str)->ptr) != RSTRING(str)->len)
- ArgError("string contains `\0'");
+ ArgError("string contains `\\0'");
id = rb_intern(RSTRING(str)->ptr);
return INT2FIX(id);
}