diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-15 06:03:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-15 06:03:02 +0000 |
commit | 36f6ce40832a8c19301898ff20c370d5d4638923 (patch) | |
tree | a1bbc33aa499bc1092e2f0770bb9d801332d7c86 | |
parent | 65fcaf4113e5e9855e98c3f483f34e1bfe077203 (diff) | |
download | ruby-36f6ce40832a8c19301898ff20c370d5d4638923.tar.gz |
* file.c (ruby_enc_find_basename): allow NULL as alllen.
[ruby-dev:45363][Bug #6146]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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; |