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

* 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
This commit is contained in:
nobu 2012-03-15 06:03:02 +00:00
parent 65fcaf4113
commit 36f6ce4083
2 changed files with 6 additions and 1 deletions

View file

@ -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> Thu Mar 15 14:49:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_conv_enc_opts): default to original encoding. * string.c (rb_str_conv_enc_opts): default to original encoding.

2
file.c
View file

@ -3563,7 +3563,7 @@ ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encodin
#endif #endif
long f = 0, n = -1; long f = 0, n = -1;
end = name + *alllen; end = name + (alllen ? (size_t)*alllen : strlen(name));
name = skipprefix(name, end, enc); name = skipprefix(name, end, enc);
#if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC #if defined DOSISH_DRIVE_LETTER || defined DOSISH_UNC
root = name; root = name;