mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-24 16:04:40 +08:00
Use env variable USERPROFILE instead of HOME for windows and mingw.
re: https://github.com/Unidata/netcdf-c/issues/2380 re: https://github.com/Unidata/netcdf-c/issues/2337 This PARTIALLY fixes some HOME problems because under Windows, the HOME environment variable may not be set. In that case, use the USERPROFILE environment variable instead.
This commit is contained in:
parent
a3998aa2f0
commit
7a22b7c630
@ -81,9 +81,9 @@ NCDISPATCH_initialize(void)
|
||||
/* Capture $HOME */
|
||||
{
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
char* home = getenv("HOME");
|
||||
#else
|
||||
char* home = getenv("USERPROFILE");
|
||||
#else
|
||||
char* home = getenv("HOME");
|
||||
#endif
|
||||
if(home == NULL) {
|
||||
/* use cwd */
|
||||
|
Loading…
Reference in New Issue
Block a user