mirror of
https://github.com/curl/curl.git
synced 2026-07-11 15:57:17 +03:00
curl: show better error message when no homedir is found
Reported-by: Vlastimil Ovčáčík Fixes #4644 Closes #4665
This commit is contained in:
parent
0092b6bf8a
commit
7dffc2b46f
3 changed files with 19 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue