Fix resuming a download when using curl.

Noticed a bug; when using curl a workaround for its empty file behavior
overwrote the file content, so it never resumed and always started over.
This commit is contained in:
Joey Hess 2018-04-06 16:09:53 -04:00
parent 0f6775f1ff
commit 36e6b8abbf
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 3 additions and 1 deletions

View file

@ -295,7 +295,8 @@ download' quiet url file uo = do
curl = do
-- curl does not create destination file
-- if the url happens to be empty, so pre-create.
writeFile file ""
unlessM (doesFileExist file) $
writeFile file ""
go "curl" $ headerparams ++ quietopt "-sS" ++
[ Param "-f"
, Param "-L"