From 662ab9eeb72efa445f6225fb586556283385635c Mon Sep 17 00:00:00 2001 From: Niklas Jansson Date: Mon, 5 Jun 2017 12:32:37 +0200 Subject: [PATCH] fixed bad characters in directories for windows --- lib/wayback_machine_downloader.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/wayback_machine_downloader.rb b/lib/wayback_machine_downloader.rb index 913174b..55de71d 100644 --- a/lib/wayback_machine_downloader.rb +++ b/lib/wayback_machine_downloader.rb @@ -217,6 +217,7 @@ class WaybackMachineDownloader file_path = backup_path + file_path_elements[0..-1].join('/') end if Gem.win_platform? + dir_path = dir_path.gsub(/[:*?&=<>\\|]/) {|s| '%' + s.ord.to_s(16) } file_path = file_path.gsub(/[:*?&=<>\\|]/) {|s| '%' + s.ord.to_s(16) } end unless File.exists? file_path