Remove a drive letter in Windows

This commit is contained in:
sk-ys 2022-05-17 19:30:13 +09:00
parent a1d99e1805
commit bcfd73b900

View File

@ -143,6 +143,8 @@ module Dav4rack
collection = path.end_with?('/') collection = path.end_with?('/')
path = ::File.expand_path path path = ::File.expand_path path
path << '/' if collection and !path.end_with?('/') path << '/' if collection and !path.end_with?('/')
# remove a drive letter in Windows
path.gsub!(/^([^\/]*)\//, '/')
path path
end end