From e4ba0934c2992f00275bd24e8c4d25d6b9ea10ff Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Sep 2011 00:11:32 -0400 Subject: [PATCH] fix / escape --- Command/AddUrl.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index 9fc68ca037..b4e3ad9bdf 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