mirror of
https://github.com/curl/curl.git
synced 2026-06-08 16:44:16 +03:00
[tool_parsecfg]: check HOME and USERPROFILE on all platforms in order
This commit is contained in:
parent
fdf6b5d4ef
commit
54474a7238
1 changed files with 7 additions and 5 deletions
|
|
@ -209,11 +209,13 @@ int parseconfig(const char *filename)
|
|||
|
||||
/* expand tilde-characters to the users home directory */
|
||||
if(param && param[0] == '~') {
|
||||
#ifdef _WIN32
|
||||
const char *home = curl_getenv("UserProfile");
|
||||
#else
|
||||
const char *home = curl_getenv("HOME");
|
||||
#endif
|
||||
char *home = curl_getenv("HOME");
|
||||
if(!home)
|
||||
home = curl_getenv("USERPROFILE");
|
||||
if(!home) {
|
||||
rc = 1; /* cannot find home */
|
||||
break;
|
||||
}
|
||||
if(home) {
|
||||
char *tparam = strdup(param + 1);
|
||||
if(!tparam) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue