summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-01-14 08:30:26 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-01-14 08:30:26 +0100
commit6ce0189bc8324a932c3339bcbc44d2d0572a586f (patch)
tree171654440a5f7be1e0b97e2e3dc57533a08f0169
parent84853d94f2b8ac1cfd2ed3e3849e2af0f464d22c (diff)
downloadcurl-6ce0189bc8324a932c3339bcbc44d2d0572a586f.tar.gz
curl: remove "separators" (when using globbed URLs)
Unless muted (with -s) When doing globbing, curl would output mime-like separators between the separate transfers. This is not documented anywhere, surprises users and clobbers the output. Reported-by: jonny112 on github Bug: https://github.com/curl/curl/discussions/8257
-rw-r--r--src/tool_operate.c22
-rw-r--r--src/tool_operate.h4
2 files changed, 1 insertions, 25 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index fe2c43b55..daeb02e6b 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -90,8 +90,6 @@
CURLcode curl_easy_perform_ev(CURL *easy);
#endif
-#define CURLseparator "--_curl_--"
-
#ifndef O_BINARY
/* since O_BINARY as used in bitmasks, setting it to zero makes it usable in
source code but yet it doesn't ruin anything */
@@ -265,11 +263,6 @@ static CURLcode pre_transfer(struct GlobalConfig *global,
struct_stat fileinfo;
CURLcode result = CURLE_OK;
- if(per->separator_err)
- fprintf(global->errors, "%s\n", per->separator_err);
- if(per->separator)
- printf("%s\n", per->separator);
-
if(per->uploadfile && !stdin_upload(per->uploadfile)) {
/* VMS Note:
*
@@ -633,8 +626,6 @@ static CURLcode post_per_transfer(struct GlobalConfig *global,
if(outs->alloc_filename)
free(outs->filename);
free(per->this_url);
- free(per->separator_err);
- free(per->separator);
free(per->outfile);
free(per->uploadfile);
@@ -780,7 +771,6 @@ static CURLcode single_transfer(struct GlobalConfig *global,
}
{
- int separator;
unsigned long urlnum;
if(!state->up && !infiles)
@@ -820,10 +810,6 @@ static CURLcode single_transfer(struct GlobalConfig *global,
else
urlnum = state->urlnum;
- /* if multiple files extracted to stdout, insert separators! */
- separator = ((!state->outfiles ||
- !strcmp(state->outfiles, "-")) && urlnum > 1);
-
if(state->up < state->infilenum) {
struct per_transfer *per = NULL;
struct OutStruct *outs;
@@ -1159,14 +1145,6 @@ static CURLcode single_transfer(struct GlobalConfig *global,
global->isatty = orig_isatty;
}
- if(urlnum > 1 && !global->mute) {
- per->separator_err =
- aprintf("\n[%lu/%lu]: %s --> %s",
- state->li + 1, urlnum, per->this_url,
- per->outfile ? per->outfile : "<stdout>");
- if(separator)
- per->separator = aprintf("%s%s", CURLseparator, per->this_url);
- }
if(httpgetfields) {
char *urlbuffer;
/* Find out whether the url contains a file name */
diff --git a/src/tool_operate.h b/src/tool_operate.h
index 61994052f..15fad86d6 100644
--- a/src/tool_operate.h
+++ b/src/tool_operate.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -69,8 +69,6 @@ struct per_transfer {
bool ultotal_added;
/* NULL or malloced */
- char *separator_err;
- char *separator;
char *uploadfile;
};