Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed problems with zipifyFilePath:

+ Don't ever put drive in zip file path!
+ Don't put leading "./" supplied by some versions of
  System.FilePath.splitDirectories.
  • Loading branch information...
commit afb4e3b4e1092875818840efc046c863cb024dc4 1 parent a3d552c
John MacFarlane authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 Codec/Archive/Zip.hs
7 Codec/Archive/Zip.hs
View
@@ -268,9 +268,10 @@ zipifyFilePath :: FilePath -> String
zipifyFilePath path =
let dir = takeDirectory path
fn = takeFileName path
- (drive, dir') = splitDrive dir
- dirParts = splitDirectories dir'
- in drive ++ (concat (map (++ "/") dirParts)) ++ fn
+ (_drive, dir') = splitDrive dir
+ -- note: some versions of filepath return ["."] if no dir
+ dirParts = dropWhile (==".") $ splitDirectories dir'
+ in (concat (map (++ "/") dirParts)) ++ fn
-- | Uncompress a lazy bytestring.
compressData :: CompressionMethod -> B.ByteString -> B.ByteString
Please sign in to comment.
Something went wrong with that request. Please try again.