Skip to content

Commit 1dc822f

Browse files
author
aamine
committed
* lib/fileutils.rb (mkdir_p): remove trailing `/' befere mkdir(2). mkdir("nonexistdir/") does not work on NetBSD/Alpha 1.6.1.
* lib/fileutils.rb (fu_list): call to_str for all arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent aa0e949 commit 1dc822f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/fileutils.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def mkdir_p(list, options = {})
170170
return *list if options[:noop]
171171

172172
mode = options[:mode] || (0777 & ~File.umask)
173-
list.each do |path|
173+
list.map {|path| path.sub(%r</\z>, '') }.each do |path|
174174
stack = []
175175
until path == stack.last # dirname("/")=="/", dirname("C:/")=="C:/"
176176
stack.push path
@@ -711,7 +711,7 @@ def fu_check_options(options, *optdecl)
711711
end
712712

713713
def fu_list(arg)
714-
arg.is_a?(Array) ? arg : [arg]
714+
Array(arg).map {|path| path.to_str }
715715
end
716716

717717
def fu_each_src_dest(src, dest)

0 commit comments

Comments
 (0)