[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 80/151: curl: show better error message when no homedir is found
From: |
gnunet |
Subject: |
[gnurl] 80/151: curl: show better error message when no homedir is found |
Date: |
Fri, 20 Dec 2019 14:26:29 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 7dffc2b46f78e15ac0f8e19a2c8ebeba0c032aa4
Author: Daniel Stenberg <address@hidden>
AuthorDate: Mon Dec 2 12:00:41 2019 +0100
curl: show better error message when no homedir is found
Reported-by: Vlastimil Ovčáčík
Fixes #4644
Closes #4665
---
src/tool_msgs.c | 14 ++++++++++++++
src/tool_msgs.h | 2 +-
src/tool_operate.c | 5 ++++-
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/tool_msgs.c b/src/tool_msgs.c
index 48c724940..c0e85aee6 100644
--- a/src/tool_msgs.c
+++ b/src/tool_msgs.c
@@ -32,6 +32,7 @@
#define WARN_PREFIX "Warning: "
#define NOTE_PREFIX "Note: "
+#define ERROR_PREFIX "curl: "
static void voutf(struct GlobalConfig *config,
const char *prefix,
@@ -122,3 +123,16 @@ void helpf(FILE *errors, const char *fmt, ...)
#endif
"for more information\n");
}
+
+/*
+ * Emit error message on error stream if not muted.
+ */
+void errorf(struct GlobalConfig *config, const char *fmt, ...)
+{
+ if(!config->mute) {
+ va_list ap;
+ va_start(ap, fmt);
+ voutf(config, ERROR_PREFIX, fmt, ap);
+ va_end(ap);
+ }
+}
diff --git a/src/tool_msgs.h b/src/tool_msgs.h
index bd8480d30..2c4afd180 100644
--- a/src/tool_msgs.h
+++ b/src/tool_msgs.h
@@ -25,7 +25,7 @@
void warnf(struct GlobalConfig *config, const char *fmt, ...);
void notef(struct GlobalConfig *config, const char *fmt, ...);
-
void helpf(FILE *errors, const char *fmt, ...);
+void errorf(struct GlobalConfig *config, const char *fmt, ...);
#endif /* HEADER_CURL_TOOL_MSGS_H */
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 23971f112..ab3a7f1a0 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1615,7 +1615,7 @@ static CURLcode single_transfer(struct GlobalConfig
*global,
if(!config->insecure_ok) {
char *home;
char *file;
- result = CURLE_OUT_OF_MEMORY;
+ result = CURLE_FAILED_INIT;
home = homedir();
if(home) {
file = aprintf("%s/.ssh/known_hosts", home);
@@ -1629,6 +1629,9 @@ static CURLcode single_transfer(struct GlobalConfig
*global,
}
Curl_safefree(home);
}
+ else {
+ errorf(global, "Failed to figure out user's home dir!");
+ }
if(result)
break;
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 104/151: tests: use \r\n for log messages in WSL, (continued)
- [gnurl] 104/151: tests: use \r\n for log messages in WSL, gnunet, 2019/12/20
- [gnurl] 88/151: azure: add more builds, gnunet, 2019/12/20
- [gnurl] 93/151: setopt: Fix ALPN / NPN user option when built without HTTP2, gnunet, 2019/12/20
- [gnurl] 100/151: conncache: fix multi-thread use of shared connection cache, gnunet, 2019/12/20
- [gnurl] 111/151: vtls: make BearSSL possible to set with CURL_SSL_BACKEND, gnunet, 2019/12/20
- [gnurl] 109/151: travis: remove "coverage", make it "torture", gnunet, 2019/12/20
- [gnurl] 77/151: azure-pipelines: fix the test script, gnunet, 2019/12/20
- [gnurl] 73/151: build: Disable Visual Studio warning "conditional expression is constant", gnunet, 2019/12/20
- [gnurl] 79/151: OPENSOCKETFUNCTION.3: correct the purpose description, gnunet, 2019/12/20
- [gnurl] 84/151: curl_setup: disable IPv6 resolver without `getaddrinfo`, gnunet, 2019/12/20
- [gnurl] 80/151: curl: show better error message when no homedir is found,
gnunet <=
- [gnurl] 83/151: github action/azure pipeline: run 'make test-nonflaky' for tests, gnunet, 2019/12/20
- [gnurl] 82/151: openssl: CURLSSLOPT_NO_PARTIALCHAIN can disable partial cert chains, gnunet, 2019/12/20
- [gnurl] 85/151: configure: enable IPv6 support without `getaddrinfo`, gnunet, 2019/12/20
- [gnurl] 87/151: CURLOPT_VERBOSE.3: see also ERRORBUFFER, gnunet, 2019/12/20
- [gnurl] 98/151: curl: make the etag load logic work without fseek, gnunet, 2019/12/20
- [gnurl] 103/151: winbuild: Define CARES_STATICLIB when WITH_CARES=static, gnunet, 2019/12/20
- [gnurl] 90/151: test342: make it return a 304 as the tag matches, gnunet, 2019/12/20
- [gnurl] 99/151: azure: add a vanilla macos build, gnunet, 2019/12/20
- [gnurl] 105/151: tests: fix permissions of ssh keys in WSL, gnunet, 2019/12/20
- [gnurl] 102/151: conn: always set bits.close with connclose(), gnunet, 2019/12/20