remove SafeFilePath

Move sanitizeFilePath call to where fromSafeFilePath had been.
This commit is contained in:
Joey Hess 2020-05-11 14:04:56 -04:00
parent cabbc91b18
commit 5f5170b22b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 16 additions and 32 deletions

View file

@ -136,13 +136,13 @@ checkUrl addunlockedmatcher r o u = do
go _ (Left e) = void $ commandAction $ startingAddUrl u o $ do
warning (show e)
next $ return False
go deffile (Right (UrlContents sz mf)) = do
let f = adjustFile o (fromMaybe (maybe deffile fromSafeFilePath mf) (fileOption (downloadOptions o)))
go deffile (Right (UrlContents sz f)) = do
let f = adjustFile o (fromMaybe (maybe deffile sanitizeFilePath mf) (fileOption (downloadOptions o)))
void $ commandAction $ startRemote addunlockedmatcher r o f u sz
go deffile (Right (UrlMulti l)) = case fileOption (downloadOptions o) of
Nothing ->
forM_ l $ \(u', sz, f) -> do
let f' = adjustFile o (deffile </> fromSafeFilePath f)
let f' = adjustFile o (deffile </> sanitizeFilePath f)
void $ commandAction $ startRemote addunlockedmatcher r o f' u' sz
Just f -> case l of
[] -> noop