diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | string.c | 1 |
2 files changed, 6 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Thu Mar 27 03:26:40 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net> + + * string.c (rb_str_capitalize_bang): check length before upcase + first character. (ruby-bugs:PR#697) + Wed Mar 26 20:25:10 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net> * dln.c (dln_find_1): break if path list end, even for too long @@ -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); |