diff options
author | Joey Hess <joey@kitenet.net> | 2011-09-09 00:11:32 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-09-09 00:11:32 -0400 |
commit | e4ba0934c2992f00275bd24e8c4d25d6b9ea10ff (patch) | |
tree | be1c61e073291b47589daa09aafa4328c042007e | |
parent | 03d6209e1ccee4a8df7d1b0336c1d5587a2b3ff6 (diff) |
fix / escape
-rw-r--r-- | Command/AddUrl.hs | 3 |
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 |