diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | file.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Thu Mar 15 15:02:58 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * file.c (ruby_enc_find_basename): allow NULL as alllen. + [ruby-dev:45363][Bug #6146] + Thu Mar 15 14:49:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> * string.c (rb_str_conv_enc_opts): default to original encoding. @@ -3563,7 +3563,7 @@ ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encodin #endif long f = 0, n = -1; - end = name + *alllen; + end = name + (alllen ? (size_t)*alllen : strlen(name)); name = skipprefix(name, end, enc); #if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC root = name; |