From a86d937b5b4dd8348bdf3d08ceea7cfe1aa43668 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 16 Feb 2012 02:09:09 -0400 Subject: avoid too long filename when making up a filename for addurl too --- Command/AddUrl.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Command/AddUrl.hs') 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 -- cgit v1.2.3