diff --git a/src/Vervis/Ssh.hs b/src/Vervis/Ssh.hs index 2aded99..ea97f71 100644 --- a/src/Vervis/Ssh.hs +++ b/src/Vervis/Ssh.hs @@ -143,8 +143,10 @@ authorize (PublicKey name key) = do --TOD TODO TODO check paths for safety... no /./ or /../ and so on darcsRepoSpecP :: Parser RepoSpec -darcsRepoSpecP = SpecUserRepo <$> part <* char '/' <*> part <* char '/' +darcsRepoSpecP = f <$> part <* char '/' <*> optional (part <* char '/') where + f repo Nothing = SpecRepo repo + f sharer (Just repo) = SpecUserRepo sharer repo part = takeWhile1 (/= '/') gitRepoSpecP :: Parser RepoSpec