avoid partial !! in gpg list-keys parser
This commit is contained in:
parent
a10b9a552c
commit
5513e71723
1 changed files with 3 additions and 3 deletions
|
@ -87,9 +87,9 @@ findPubKeys :: String -> IO KeyIds
|
||||||
findPubKeys for = KeyIds . parse <$> readStrict params
|
findPubKeys for = KeyIds . parse <$> readStrict params
|
||||||
where
|
where
|
||||||
params = [Params "--with-colons --list-public-keys", Param for]
|
params = [Params "--with-colons --list-public-keys", Param for]
|
||||||
parse = map keyIdField . filter pubKey . lines
|
parse = catMaybes . map (keyIdField . split ":") . lines
|
||||||
pubKey = isPrefixOf "pub:"
|
keyIdField ("pub":_:_:_:f:_) = Just f
|
||||||
keyIdField s = split ":" s !! 4
|
keyIdField _ = Nothing
|
||||||
|
|
||||||
{- Creates a block of high-quality random data suitable to use as a cipher.
|
{- Creates a block of high-quality random data suitable to use as a cipher.
|
||||||
- It is armored, to avoid newlines, since gpg only reads ciphers up to the
|
- It is armored, to avoid newlines, since gpg only reads ciphers up to the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue