Delete trailing white spaces
This commit is contained in:
parent
e61bc7b897
commit
a0fd5d6c6a
@ -77,7 +77,7 @@ dataSize (Left _) = Nothing
|
|||||||
dataSize (Right b) = Just $ fromIntegral $ BSL.length b
|
dataSize (Right b) = Just $ fromIntegral $ BSL.length b
|
||||||
|
|
||||||
toDOSTime :: LocalTime -> (Word16, Word16)
|
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 hour `shiftL` 11 .|. fromIntegral mins `shiftL` 5 .|. truncate secs `shiftR` 1
|
||||||
, fromIntegral (year - 1980) `shiftL` 9 .|. fromIntegral month `shiftL` 5 .|. fromIntegral day
|
, 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.
|
-- 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).
|
-- Any errors are thrown in the underlying monad (as 'ZipError's).
|
||||||
zipStream ::
|
zipStream ::
|
||||||
( MonadThrow m
|
( MonadThrow m
|
||||||
#if MIN_VERSION_conduit(1,3,0)
|
#if MIN_VERSION_conduit(1,3,0)
|
||||||
, PrimMonad m
|
, PrimMonad m
|
||||||
@ -110,7 +110,7 @@ zipStream ZipOptions{..} = execStateC 0 $ do
|
|||||||
cdoff <- get
|
cdoff <- get
|
||||||
output cdir
|
output cdir
|
||||||
eoff <- get
|
eoff <- get
|
||||||
endDirectory cdoff (eoff - cdoff) cnt
|
endDirectory cdoff (eoff - cdoff) cnt
|
||||||
where
|
where
|
||||||
next cnt dir = C.await >>= maybe
|
next cnt dir = C.await >>= maybe
|
||||||
(return (cnt, dir))
|
(return (cnt, dir))
|
||||||
|
|||||||
@ -52,7 +52,7 @@ main = do
|
|||||||
unless (null args) $ do
|
unless (null args) $ do
|
||||||
hPutStrLn stderr $ "Usage: " ++ prog ++ "\nRead a zip file from stdin and extract it in the current directory."
|
hPutStrLn stderr $ "Usage: " ++ prog ++ "\nRead a zip file from stdin and extract it in the current directory."
|
||||||
exitFailure
|
exitFailure
|
||||||
ZipInfo{..} <- C.runConduit
|
ZipInfo{..} <- C.runConduit
|
||||||
$ CB.sourceHandle stdin
|
$ CB.sourceHandle stdin
|
||||||
C..| C.fuseUpstream unZipStream extract
|
C..| C.fuseUpstream unZipStream extract
|
||||||
BSC.putStrLn zipComment
|
BSC.putStrLn zipComment
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user