1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* file.c (rmext): no extension to strip if empty string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-01-25 02:40:29 +00:00
parent a2905fb2a0
commit b094ab0948
2 changed files with 4 additions and 2 deletions

View file

@ -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)

2
file.c
View file

@ -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) {