summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-08-26 07:43:34 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-08-26 08:00:42 +0200
commit86b768fce2c9cea1ff1051a32bc0d3e4f7f696d4 (patch)
tree00d408e6bd9bfde7e7a5abd62999864a85dac488
parent92f2a0a06b699c572d2f6919bcffd630e8a2ead9 (diff)
downloadcurl-bagder/curl-O-error.tar.gz
curl: better error message when -O fails to get a good namebagder/curl-O-error
Fixes #7628
-rw-r--r--src/tool_operate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 74221599d..960f3020a 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -950,8 +950,11 @@ static CURLcode single_transfer(struct GlobalConfig *global,
if(!per->outfile) {
/* extract the file name from the URL */
result = get_url_file_name(&per->outfile, per->this_url);
- if(result)
+ if(result) {
+ errorf(global, "Failed to extract a sensible file name"
+ " from the URL to use for storage!\n");
break;
+ }
if(!*per->outfile && !config->content_disposition) {
errorf(global, "Remote file name has no length!\n");
result = CURLE_WRITE_ERROR;