Support filenames that start with a dash; when such a file is passed to a utility it will be escaped to avoid it being interpreted as an option.

This commit is contained in:
Joey Hess 2011-02-25 01:13:01 -04:00
parent e61b47bc8a
commit 836e71297b
9 changed files with 29 additions and 10 deletions

View file

@ -51,6 +51,6 @@ downloadUrl :: Key -> FilePath -> Annex Bool
downloadUrl key file = do
showNote "downloading"
showProgress -- make way for curl progress bar
liftIO $ boolSystem "curl" ["-#", "-o", file, url]
liftIO $ boolSystem "curl" ["-#", "-o", utilityEscape file, url]
where
url = join ":" $ drop 1 $ split ":" $ show key