From 2784a585b304fd21fa024dd3f327886b722cf6c0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 10 Jun 2021 16:18:22 +0200 Subject: [PATCH] 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 --- src/tool_operate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tool_operate.c b/src/tool_operate.c index 8fb0ef2e7c..3c580ffaea 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; -- 2.47.3