>From d230c6e0fa28deab03e5d30418599944a26f79fa Mon Sep 17 00:00:00 2001 From: Matthew White Date: Thu, 28 Jul 2016 17:36:51 +0200 Subject: [PATCH] New: --continue continues partially downloaded Metalink's files * src/metalink.c (retrieve_from_metalink): Continue file download if opt.always_rest is true Without --continue, download as a new file with an unique name (this conforms to the old behaviour). --- src/metalink.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/metalink.c b/src/metalink.c index 545b0cb..5d7e9b2 100644 --- a/src/metalink.c +++ b/src/metalink.c @@ -153,7 +153,13 @@ retrieve_from_metalink (const metalink_t* metalink) To do that we create the local file here and put it as output_stream. We restore the original configuration after we are finished with the file. */ - output_stream = unique_create (mfile->name, true, &filename); + if (opt.always_rest) + // continue previous download + output_stream = fopen (mfile->name, "ab"); + else + // create a file with an unique name + output_stream = unique_create (mfile->name, true, &filename); + output_stream_regular = true; /* Bug: utils.h (unique_create): cannot create a -- 2.7.3