summaryrefslogtreecommitdiff
path: root/src/tool_operate.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-06-10 16:18:22 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-06-11 12:50:46 +0200
commit2784a585b304fd21fa024dd3f327886b722cf6c0 (patch)
tree7ea5423147de7b8edc4202b1faa4ca2f31e17352 /src/tool_operate.c
parenta15d146f47c5a0962fcd87566359d011a623a678 (diff)
downloadcurl-2784a585b304fd21fa024dd3f327886b722cf6c0.tar.gz
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
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r--src/tool_operate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 8fb0ef2e7..3c580ffae 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -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;