We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1728254 commit ca3432cCopy full SHA for ca3432c
1 file changed
pathname_builtin.rb
@@ -299,9 +299,9 @@ def mkpath(mode: nil)
299
path = @path == '/' ? @path : @path.chomp('/')
300
301
stack = []
302
- until File.directory?(path) || File.dirname(path) == path
+ until File.directory?(path) || (parent = File.dirname(path)) == path
303
stack.push path
304
- path = File.dirname(path)
+ path = parent
305
end
306
307
stack.reverse_each do |dir|
0 commit comments