diff --git a/ChangeLog b/ChangeLog index 124abd50ad..f9a395ab38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -Wed Jan 25 11:32:03 2012 Nobuyoshi Nakada +Wed Jan 25 11:40:26 2012 Nobuyoshi Nakada + + * 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) diff --git a/file.c b/file.c index d1686e2533..b9309243dd 100644 --- a/file.c +++ b/file.c @@ -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) {