From fcdc4797a9ab2b792a9bb20f2ca9802b8f6d5a1e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 28 Feb 2011 16:10:16 -0400 Subject: use ShellParam type So, I have a type checked safe handling of filenames starting with dashes, throughout the code. --- Backend/SHA1.hs | 2 +- Backend/URL.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Backend') diff --git a/Backend/SHA1.hs b/Backend/SHA1.hs index e1830bc13..a7f592b73 100644 --- a/Backend/SHA1.hs +++ b/Backend/SHA1.hs @@ -32,7 +32,7 @@ backend = Backend.File.backend { sha1 :: FilePath -> Annex String sha1 file = do showNote "checksum..." - liftIO $ pOpen ReadFromPipe "sha1sum" [utilityEscape file] $ \h -> do + liftIO $ pOpen ReadFromPipe "sha1sum" (toShell [File file]) $ \h -> do line <- hGetLine h let bits = split " " line if null bits diff --git a/Backend/URL.hs b/Backend/URL.hs index 15cc88d64..864c79301 100644 --- a/Backend/URL.hs +++ b/Backend/URL.hs @@ -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", utilityEscape file, url] + liftIO $ boolSystem "curl" [Params "-# -o", File file, File url] where url = join ":" $ drop 1 $ split ":" $ show key -- cgit v1.2.3