Proposed fix for #5192

Strip drive name only when necessary.
This commit is contained in:
Heng, K. (Stephen) 2016-08-18 12:02:00 +08:00 committed by GitHub
parent 9061f0b1f3
commit 596f5d1af3
1 changed files with 2 additions and 2 deletions

View File

@ -160,11 +160,11 @@ module Jekyll
questionable_path.insert(0, "/") if questionable_path.start_with?("~")
clean_path = File.expand_path(questionable_path, "/")
clean_path.sub!(%r!\A\w:/!, "/")
if clean_path.start_with?(base_directory.sub(%r!\A\w:/!, "/"))
if clean_path.start_with?(base_directory)
clean_path
else
clean_path.sub!(%r!\A\w:/!, "/")
File.join(base_directory, clean_path)
end
end