fix parsing of empty content identifier

Seems very unlikely an empty content identifier would be used, but
quickcheck found this bug.
This commit is contained in:
Joey Hess 2019-02-21 13:44:09 -04:00
parent 9887a378fe
commit 1f6339ade7
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -44,7 +44,7 @@ parseContentIdentifierList :: A.Parser [ContentIdentifier]
parseContentIdentifierList = reverse . catMaybes <$> valueparser []
where
valueparser l = do
b <- A8.takeWhile1 (/= ' ')
b <- A8.takeWhile (/= ' ')
let cid = if "!" `S8.isPrefixOf` b
then ContentIdentifier <$> fromB64Maybe' (S.drop 1 b)
else Just $ ContentIdentifier b