curl: support XDG_CONFIG_HOME to find .curlrc

Added test433 to verify. Updated documentation.

Reviewed-by: Jay Satiro
Suggested-by: Eli Schwartz
Fixes #5829
Closes #5837
This commit is contained in:
Daniel Stenberg 2020-08-21 23:40:12 +02:00
parent 98c94596f5
commit 4be1f8dc01
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 120 additions and 12 deletions

View file

@ -82,7 +82,7 @@ int parseconfig(const char *filename, struct GlobalConfig *global)
if(!filename || !*filename) {
/* NULL or no file name attempts to load .curlrc from the homedir! */
char *home = homedir(); /* portable homedir finder */
char *home = homedir(".curlrc");
#ifndef WIN32
if(home) {
pathalloc = curl_maprintf("%s%s.curlrc", home, DIR_CHAR);