fix reading of empty filename from transfer info file

This commit is contained in:
Joey Hess 2012-07-02 11:02:47 -04:00
parent 760e028dca
commit 8f6c2e6081

View file

@ -165,10 +165,8 @@ readTransferInfo pid s =
<*> pure (Just pid) <*> pure (Just pid)
<*> pure Nothing <*> pure Nothing
<*> pure Nothing <*> pure Nothing
<*> pure filename <*> pure (if null filename then Nothing else Just filename)
_ -> Nothing _ -> Nothing
where where
(bits, filebits) = splitAt 1 $ lines s (bits, filebits) = splitAt 1 $ lines s
filename filename = join "\n" filebits
| null filebits = Nothing
| otherwise = Just $ join "\n" filebits