aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/curl/src/tool_msgs.c
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-01-18 11:28:56 +0100
committerGitHub <noreply@github.com>2024-01-18 11:28:56 +0100
commit9d0a3761b3201e0d9db879a7adf91876ebdb0564 (patch)
tree541d11ac878c18efd7ebca81e35112aa0fef995b /contrib/libs/curl/src/tool_msgs.c
parent404ef8886ecc9736bc58ade6da2fbd83b486a408 (diff)
downloadydb-9d0a3761b3201e0d9db879a7adf91876ebdb0564.tar.gz
Library import 8 (#1074)
* Library import 8 * Add contrib/libs/cxxsupp/libcxx/include/__verbose_abort
Diffstat (limited to 'contrib/libs/curl/src/tool_msgs.c')
-rw-r--r--contrib/libs/curl/src/tool_msgs.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/contrib/libs/curl/src/tool_msgs.c b/contrib/libs/curl/src/tool_msgs.c
index a880a667eb..c914836db7 100644
--- a/contrib/libs/curl/src/tool_msgs.c
+++ b/contrib/libs/curl/src/tool_msgs.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 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
@@ -42,7 +42,8 @@ static void voutf(struct GlobalConfig *config,
va_list ap)
{
size_t width = (79 - strlen(prefix));
- if(!config->mute) {
+ DEBUGASSERT(!strchr(fmt, '\n'));
+ if(!config->silent) {
size_t len;
char *ptr;
char *print_buffer;
@@ -54,7 +55,7 @@ static void voutf(struct GlobalConfig *config,
ptr = print_buffer;
while(len > 0) {
- fputs(prefix, config->errors);
+ fputs(prefix, tool_stderr);
if(len > width) {
size_t cut = width-1;
@@ -67,13 +68,14 @@ static void voutf(struct GlobalConfig *config,
max text width then! */
cut = width-1;
- (void)fwrite(ptr, cut + 1, 1, config->errors);
- fputs("\n", config->errors);
+ (void)fwrite(ptr, cut + 1, 1, tool_stderr);
+ fputs("\n", tool_stderr);
ptr += cut + 1; /* skip the space too */
len -= cut + 1;
}
else {
- fputs(ptr, config->errors);
+ fputs(ptr, tool_stderr);
+ fputs("\n", tool_stderr);
len = 0;
}
}
@@ -115,9 +117,11 @@ void helpf(FILE *errors, const char *fmt, ...)
if(fmt) {
va_list ap;
va_start(ap, fmt);
+ DEBUGASSERT(!strchr(fmt, '\n'));
fputs("curl: ", errors); /* prefix it */
vfprintf(errors, fmt, ap);
va_end(ap);
+ fputs("\n", errors); /* newline it */
}
fprintf(errors, "curl: try 'curl --help' "
#ifdef USE_MANUAL
@@ -132,7 +136,7 @@ void helpf(FILE *errors, const char *fmt, ...)
*/
void errorf(struct GlobalConfig *config, const char *fmt, ...)
{
- if(!config->mute) {
+ if(!config->silent || config->showerror) {
va_list ap;
va_start(ap, fmt);
voutf(config, ERROR_PREFIX, fmt, ap);