summaryrefslogtreecommitdiff
path: root/Command/AddUrl.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/AddUrl.hs')
-rw-r--r--Command/AddUrl.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index 9fc68ca03..b4e3ad9bd 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -79,8 +79,9 @@ url2file :: URI -> IO FilePath
url2file url = do
whenM (doesFileExist file) $
error $ "already have this url in " ++ file
+ liftIO $ print file
return file
where
file = escape $ uriRegName auth ++ uriPath url ++ uriQuery url
- escape = replace "/?" $ repeat '_'
+ escape = replace "/" "_" . replace "?" "_"
auth = fromMaybe (error $ "bad url " ++ show url) $ uriAuthority url