single_transfer: ignore blank --output-dir

... as otherwise it creates a rather unexpected target directory with a
leading slash.

Reported-by: Harry Sintonen
Fixes #7218
Closes #7233
This commit is contained in:
Daniel Stenberg 2021-06-10 16:18:22 +02:00
parent a15d146f47
commit 2784a585b3
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 1 additions and 1 deletions

View File

@ -970,7 +970,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
}
}
if(config->output_dir) {
if(config->output_dir && *config->output_dir) {
char *d = aprintf("%s/%s", config->output_dir, per->outfile);
if(!d) {
result = CURLE_WRITE_ERROR;