summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-15 06:03:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-15 06:03:02 +0000
commit36f6ce40832a8c19301898ff20c370d5d4638923 (patch)
treea1bbc33aa499bc1092e2f0770bb9d801332d7c86 /file.c
parent65fcaf4113e5e9855e98c3f483f34e1bfe077203 (diff)
* 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
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/file.c b/file.c
index 1869a29c3b..49032957d0 100644
--- a/file.c
+++ b/file.c
@@ -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;