diff options
author | Joey Hess <joeyh@joeyh.name> | 2014-12-11 20:10:45 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2014-12-11 20:10:45 -0400 |
commit | 743dcc87eee871833b3c676fcd0fcb16f6ad3349 (patch) | |
tree | fa351fc121bb58c0d068141a41af8c82113b0291 /Command | |
parent | 892eac7f77f0e54fc8003ca9e306a76d59ebc519 (diff) |
truncate over-long paths
Diffstat (limited to 'Command')
-rw-r--r-- | Command/AddUrl.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index 825d9bdbf..667d72895 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -81,9 +81,11 @@ seek us = do startRemote :: Remote -> Bool -> FilePath -> URLString -> Maybe Integer -> CommandStart startRemote r relaxed file uri sz = do - showStart "addurl" file + pathmax <- liftIO $ fileNameLengthLimit "." + let file' = truncateFilePath pathmax file + showStart "addurl" file' showNote $ "from " ++ Remote.name r - next $ performRemote r relaxed uri file sz + next $ performRemote r relaxed uri file' sz performRemote :: Remote -> Bool -> URLString -> FilePath -> Maybe Integer -> CommandPerform performRemote r relaxed uri file sz = ifAnnexed file adduri geturi |