summaryrefslogtreecommitdiff
path: root/Pancake.hs
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-11-02 16:07:16 +0300
committerdefanor <defanor@uberspace.net>2017-11-02 16:07:16 +0300
commitb02d13d7084ad93d1432b6106ea9031b763a761a (patch)
tree5a5fd2249764cccc27130bb71e28d95e88f7ca69 /Pancake.hs
parentb77e94263040047bdc750fabf93022ee98be526f (diff)
Fix: remove `init`
Diffstat (limited to 'Pancake.hs')
-rw-r--r--Pancake.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Pancake.hs b/Pancake.hs
index 0c15648..20e8c43 100644
--- a/Pancake.hs
+++ b/Pancake.hs
@@ -674,8 +674,11 @@ loadDocument u' = do
-- handle relative URIs
(_, False, ((cur, _):_, _)) -> relativeTo u' cur
_ -> u'
+ uScheme = case uriScheme u of
+ [] -> "unknown"
+ (_:s) -> s
cmd = maybe (defaultCommand $ conf st) id $
- M.lookup (init $ uriScheme u) (commands $ conf st)
+ M.lookup uScheme (commands $ conf st)
ext = case takeExtension $ uriPath u of
('.':xs) -> map toLower xs
other -> other