diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2022-09-05 15:25:58 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2022-09-05 15:25:58 (GMT) |
commit | c7522c3f9382fe7e2e85bed01556d590a2f43757 (patch) | |
tree | ae3953f0883f343923a56e3df1576f51d6624055 /win/tclWinInit.c | |
parent | 6a866ef98badfbed29a17955fad2767891fe7d10 (diff) | |
parent | 57807a30bb766ff5e18b94270ac3d92041b006af (diff) | |
download | tcl-c7522c3f9382fe7e2e85bed01556d590a2f43757.zip tcl-c7522c3f9382fe7e2e85bed01556d590a2f43757.tar.gz tcl-c7522c3f9382fe7e2e85bed01556d590a2f43757.tar.bz2 |
Merge 8.7. Primarily ticket [55a02f20ec]
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r-- | win/tclWinInit.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c index bbb0c81..b7b5c0d 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -513,7 +513,14 @@ TclpSetVariables( Tcl_SetVar2(interp, "env", "HOME", Tcl_DStringValue(&ds), TCL_GLOBAL_ONLY); } else { - Tcl_SetVar2(interp, "env", "HOME", "c:\\", TCL_GLOBAL_ONLY); + /* None of HOME, HOMEDRIVE, HOMEPATH exists. Try USERPROFILE */ + ptr = Tcl_GetVar2(interp, "env", "USERPROFILE", TCL_GLOBAL_ONLY); + if (ptr != NULL && ptr[0]) { + Tcl_SetVar2(interp, "env", "HOME", ptr, TCL_GLOBAL_ONLY); + } else { + /* Last resort */ + Tcl_SetVar2(interp, "env", "HOME", "c:\\", TCL_GLOBAL_ONLY); + } } } |