From 9e5ecf2bd3be27be6e8d1dd9f0bf8d80cf1eaa30 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 16 Dec 2021 15:10:30 +0100 Subject: fixed & removed a bunch of old TODOs --- lib/Paths.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Paths.hs') diff --git a/lib/Paths.hs b/lib/Paths.hs index 99774c5..7fae0df 100644 --- a/lib/Paths.hs +++ b/lib/Paths.hs @@ -36,9 +36,10 @@ parsePath text = -- how many steps upwards in the tree? up = length . filter (".." ==) . T.splitOn "/" $ prefix parts = T.splitOn "#" rest + -- `head` is unsafe, but splitOn will always produce lists with at least one element path = head parts fragment = if length parts >= 2 - then Just $ T.concat $ tail parts -- TODO! + then Just $ T.concat $ tail parts else Nothing instance PrettyPrint RelPath where -- cgit v1.2.3