Skip to content

Commit

Permalink
Fixed problems with zipifyFilePath:
Browse files Browse the repository at this point in the history
+ Don't ever put drive in zip file path!
+ Don't put leading "./" supplied by some versions of
  System.FilePath.splitDirectories.
  • Loading branch information
jgm committed Jan 30, 2011
1 parent a3d552c commit afb4e3b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Codec/Archive/Zip.hs
Expand Up @@ -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
Expand Down

0 comments on commit afb4e3b

Please sign in to comment.