]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
single_transfer: ignore blank --output-dir
authorDaniel Stenberg <daniel@haxx.se>
Thu, 10 Jun 2021 14:18:22 +0000 (16:18 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 11 Jun 2021 10:50:46 +0000 (12:50 +0200)
... as otherwise it creates a rather unexpected target directory with a
leading slash.

Reported-by: Harry Sintonen
Fixes #7218
Closes #7233

src/tool_operate.c

index 8fb0ef2e7cd84ca44a7e273fbffd6db274050f14..3c580ffaeaca49b987b9473f7bcafd3034db667f 100644 (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;