summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-02-23 07:23:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-02-23 07:23:29 (GMT)
commit8242d1a544d685846fe49557be8c9fd628d42329 (patch)
tree1f426b6cd5ab89ab92e196d98f08898aa6866c89 /generic/tclBasic.c
parent7bfe776283e21b9f434c9b47c2ac37b8451f41e8 (diff)
downloadtcl-8242d1a544d685846fe49557be8c9fd628d42329.zip
tcl-8242d1a544d685846fe49557be8c9fd628d42329.tar.gz
tcl-8242d1a544d685846fe49557be8c9fd628d42329.tar.bz2
Use _wgetenv() in stead of getenv() on Windows: The wide environment is not always well-synchonized with the locale environment. Problem detected on the sebres-8-6-clock-speedup-cr2, but this branch only exposed the bug, it did not cause it.
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 895d160..2f1819f 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -583,6 +583,10 @@ Tcl_CreateInterp(void)
Tcl_InitHashTable(&iPtr->packageTable, TCL_STRING_KEYS);
iPtr->packageUnknown = NULL;
+#ifdef _WIN32
+# define getenv(x) _wgetenv(L##x) /* On Windows, use _wgetenv below */
+#endif
+
/* TIP #268 */
if (getenv("TCL_PKG_PREFER_LATEST") == NULL) {
iPtr->packagePrefer = PKG_PREFER_STABLE;