From 13f754fca0c2d3e13b4ead800db6ef1f62e7fc85 Mon Sep 17 00:00:00 2001 From: Tyler Beason Date: Mon, 5 Feb 2018 12:40:07 -0700 Subject: [PATCH 1/2] Regex match and not escape I had trouble with `escape` butchering a folderpath into a filename. I found that using a simple regex match to pick off the filename solved my problems. Don't know if other people might have had this issue as well. I'm on Windows 7 and Julia v0.7. --- src/WinRPM.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WinRPM.jl b/src/WinRPM.jl index c6d4413..7f22324 100644 --- a/src/WinRPM.jl +++ b/src/WinRPM.jl @@ -458,7 +458,7 @@ function do_install(package::Package) error("failed to download $name $(data[2]) from $source/$path.") end cache = getcachedir(source) - path2 = joinpath(cache,escape(path)) + path2 = joinpath(cache, match(r"[^/]+$",path).match) open(path2, "w") do f write(f, data[1]) end From 78367dbd24145ab2b75d60e239656d903051cbd9 Mon Sep 17 00:00:00 2001 From: Tyler Beason Date: Tue, 6 Feb 2018 10:09:07 -0700 Subject: [PATCH 2/2] basename not regex The `basename` function does what the previous regex match did, so use that instead. --- src/WinRPM.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WinRPM.jl b/src/WinRPM.jl index 7f22324..26d5420 100644 --- a/src/WinRPM.jl +++ b/src/WinRPM.jl @@ -458,7 +458,7 @@ function do_install(package::Package) error("failed to download $name $(data[2]) from $source/$path.") end cache = getcachedir(source) - path2 = joinpath(cache, match(r"[^/]+$",path).match) + path2 = joinpath(cache, basename(path)) open(path2, "w") do f write(f, data[1]) end