mirror of
https://github.com/curl/curl.git
synced 2026-07-24 18:27:20 +03:00
curl: --continue-at is mutually exclusive with --range
Allowing both just creates a transfer with behaviors no user can properly anticipate so better just deny the combo. Fixes #15646 Reported-by: Harry Sintonen Closes #15666
This commit is contained in:
parent
fa1a8e0215
commit
fcb59534e3
3 changed files with 14 additions and 0 deletions
|
|
@ -1845,6 +1845,10 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
err = getstr(&config->cookiejar, nextarg, DENY_BLANK);
|
||||
break;
|
||||
case C_CONTINUE_AT: /* --continue-at */
|
||||
if(config->range) {
|
||||
errorf(global, "--continue-at is mutually exclusive with --range");
|
||||
return PARAM_BAD_USE;
|
||||
}
|
||||
/* This makes us continue an ftp transfer at given position */
|
||||
if(strcmp(nextarg, "-")) {
|
||||
err = str2offset(&config->resume_from, nextarg);
|
||||
|
|
@ -2397,6 +2401,10 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
}
|
||||
break;
|
||||
case C_RANGE: /* --range */
|
||||
if(config->use_resume) {
|
||||
errorf(global, "--continue-at is mutually exclusive with --range");
|
||||
return PARAM_BAD_USE;
|
||||
}
|
||||
/* Specifying a range WITHOUT A DASH will create an illegal HTTP range
|
||||
(and will not actually be range by definition). The manpage
|
||||
previously claimed that to be a good way, why this code is added to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue