diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | file.c | 2 |
2 files changed, 4 insertions, 2 deletions
@@ -1,4 +1,6 @@ -Wed Jan 25 11:32:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> +Wed Jan 25 11:40:26 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * file.c (rmext): no extension to strip if empty string. * file.c (rb_enc_path_next, rb_enc_path_skip_prefix) (rb_enc_path_last_separator, rb_enc_path_end) @@ -3535,7 +3535,7 @@ rmext(const char *p, long l0, long l1, const char *e, long l2, rb_encoding *enc) unsigned int c; const char *s, *last; - if (!e) return 0; + if (!e || !l2) return 0; c = rb_enc_codepoint_len(e, e + l2, &len1, enc); if (rb_enc_ascget(e + len1, e + l2, &len2, enc) == '*' && len1 + len2 == l2) { |