diff --git a/Codec/Archive/Zip/Conduit/Zip.hs b/Codec/Archive/Zip/Conduit/Zip.hs index a802ac5..85c9f74 100644 --- a/Codec/Archive/Zip/Conduit/Zip.hs +++ b/Codec/Archive/Zip/Conduit/Zip.hs @@ -77,7 +77,7 @@ dataSize (Left _) = Nothing dataSize (Right b) = Just $ fromIntegral $ BSL.length b toDOSTime :: LocalTime -> (Word16, Word16) -toDOSTime (LocalTime (toGregorian -> (year, month, day)) (TimeOfDay hour mins secs)) = +toDOSTime (LocalTime (toGregorian -> (year, month, day)) (TimeOfDay hour mins secs)) = ( fromIntegral hour `shiftL` 11 .|. fromIntegral mins `shiftL` 5 .|. truncate secs `shiftR` 1 , fromIntegral (year - 1980) `shiftL` 9 .|. fromIntegral month `shiftL` 5 .|. fromIntegral day ) @@ -97,7 +97,7 @@ maxBound16 = fromIntegral (maxBound :: Word16) -- -- Depending on options, the resulting zip file should be compatible with most unzipping applications. -- Any errors are thrown in the underlying monad (as 'ZipError's). -zipStream :: +zipStream :: ( MonadThrow m #if MIN_VERSION_conduit(1,3,0) , PrimMonad m @@ -110,7 +110,7 @@ zipStream ZipOptions{..} = execStateC 0 $ do cdoff <- get output cdir eoff <- get - endDirectory cdoff (eoff - cdoff) cnt + endDirectory cdoff (eoff - cdoff) cnt where next cnt dir = C.await >>= maybe (return (cnt, dir)) diff --git a/cmd/unzip.hs b/cmd/unzip.hs index 0e92da0..c8819bf 100644 --- a/cmd/unzip.hs +++ b/cmd/unzip.hs @@ -52,7 +52,7 @@ main = do unless (null args) $ do hPutStrLn stderr $ "Usage: " ++ prog ++ "\nRead a zip file from stdin and extract it in the current directory." exitFailure - ZipInfo{..} <- C.runConduit + ZipInfo{..} <- C.runConduit $ CB.sourceHandle stdin C..| C.fuseUpstream unZipStream extract BSC.putStrLn zipComment