From 40d117ae88c4c8f2a9134fba7ba62417425877d1 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 16 Sep 2017 11:50:56 +0000 Subject: file.c: [DOC] separators at dirname and basename * file.c (rb_file_s_basename, rb_file_s_dirname): [DOC] state that trailing separators will be stripped first, like as basename(1) and dirname(1). [ruby-core:82828] [Bug #13908] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- file.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 02ec141fb4..76a9953843 100644 --- a/file.c +++ b/file.c @@ -4121,7 +4121,8 @@ ruby_enc_find_basename(const char *name, long *baselen, long *alllen, rb_encodin * call-seq: * File.basename(file_name [, suffix] ) -> base_name * - * Returns the last component of the filename given in file_name, + * Returns the last component of the filename given in + * file_name (after first stripping trailing separators), * which can be formed using both File::SEPARATOR and * File::ALT_SEPARATOR as the separator when * File::ALT_SEPARATOR is not nil. If @@ -4184,9 +4185,10 @@ rb_file_s_basename(int argc, VALUE *argv) * File.dirname(file_name) -> dir_name * * Returns all components of the filename given in file_name - * except the last one. The filename can be formed using both - * File::SEPARATOR and File::ALT_SEPARATOR as the - * separator when File::ALT_SEPARATOR is not nil. + * except the last one (after first stripping trailing separators). + * The filename can be formed using both File::SEPARATOR + * and File::ALT_SEPARATOR as the separator when + * File::ALT_SEPARATOR is not nil. * * File.dirname("/home/gumby/work/ruby.rb") #=> "/home/gumby/work" */ -- cgit v1.2.3