diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-26 18:26:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-26 18:26:45 +0000 |
commit | 040966d42e783fefe04a517ab89c8050730182f5 (patch) | |
tree | 163ac41535e8f78baa237a7707adce57c22fb555 /string.c | |
parent | 2373e961ae94124dc198381adcfcb7e4dd4620f5 (diff) | |
download | ruby-040966d42e783fefe04a517ab89c8050730182f5.tar.gz ruby-040966d42e783fefe04a517ab89c8050730182f5.tar.xz ruby-040966d42e783fefe04a517ab89c8050730182f5.zip |
* string.c (rb_str_capitalize_bang): check length before upcase
first character. (ruby-bugs:PR#697)
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -2092,6 +2092,7 @@ rb_str_capitalize_bang(str) 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)) { *s = toupper(*s); |