summaryrefslogtreecommitdiff
path: root/Command/AddUrl.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-16 02:09:09 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-16 02:09:09 -0400
commita86d937b5b4dd8348bdf3d08ceea7cfe1aa43668 (patch)
tree1cf520ab76352e96763f7ac49465a7dcf539f7ca /Command/AddUrl.hs
parent8f9b501515d215ac2befab51773b63bf0f180d5d (diff)
avoid too long filename when making up a filename for addurl too
Diffstat (limited to 'Command/AddUrl.hs')
-rw-r--r--Command/AddUrl.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index e23f4262b..981af2f7e 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -81,7 +81,7 @@ nodownload url file = do
next $ Command.Add.cleanup file key False
url2file :: URI -> FilePath
-url2file url = escape $ uriRegName auth ++ uriPath url ++ uriQuery url
+url2file url = take 255 $ escape $ uriRegName auth ++ uriPath url ++ uriQuery url
where
escape = replace "/" "_" . replace "?" "_"
auth = fromMaybe (error $ "bad url " ++ show url) $ uriAuthority url