git.iko.soy/typeable/pandoc
on master help sign in
MediaBag: Improved normalisation when writing files
b04bb3bMatthew Pickering
src/Text/Pandoc/MediaBag.hs+1−1
@@ -99,7 +99,7 @@ writeMedia :: Bool -> FilePath -> (FilePath, BL.ByteString) -> IO ()
99writeMedia verbose dir (subpath, bs) = do
99writeMedia verbose dir (subpath, bs) = do
100 -- we join and split to convert a/b/c to a\b\c on Windows;
100 -- we join and split to convert a/b/c to a\b\c on Windows;
101 -- in zip containers all paths use /
101 -- in zip containers all paths use /
102− let fullpath = dir </> joinPath (splitPath subpath)
102+ let fullpath = dir </> normalise subpath
103 createDirectoryIfMissing True $ takeDirectory fullpath
103 createDirectoryIfMissing True $ takeDirectory fullpath
104 when verbose $ UTF8.hPutStrLn stderr $ "pandoc: extracting " ++ fullpath
104 when verbose $ UTF8.hPutStrLn stderr $ "pandoc: extracting " ++ fullpath
105 BL.writeFile fullpath bs
105 BL.writeFile fullpath bs