From 596f5d1af340a78ec4d1b2666e5f281564f21479 Mon Sep 17 00:00:00 2001 From: "Heng, K. (Stephen)" Date: Thu, 18 Aug 2016 12:02:00 +0800 Subject: [PATCH] Proposed fix for #5192 Strip drive name only when necessary. --- lib/jekyll.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll.rb b/lib/jekyll.rb index a9fe696f..ffe9e4ac 100644 --- a/lib/jekyll.rb +++ b/lib/jekyll.rb @@ -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