diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-02-23 07:23:29 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-02-23 07:23:29 (GMT) |
| commit | 8242d1a544d685846fe49557be8c9fd628d42329 (patch) | |
| tree | 1f426b6cd5ab89ab92e196d98f08898aa6866c89 /generic/tclIOUtil.c | |
| parent | 7bfe776283e21b9f434c9b47c2ac37b8451f41e8 (diff) | |
| download | tcl-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/tclIOUtil.c')
| -rw-r--r-- | generic/tclIOUtil.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index 5566f3e..312fd08 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -3158,6 +3158,13 @@ Tcl_FSLoadFile( * present and set to true (any integer > 0) then the unlink is skipped. */ +#ifdef _WIN32 +#define getenv(x) _wgetenv(L##x) +#define atoi(x) _wtoi(x) +#else +#define WCHAR char +#endif + static int skipUnlink (Tcl_Obj* shlibFile) { @@ -3178,9 +3185,9 @@ skipUnlink (Tcl_Obj* shlibFile) #ifdef hpux return 1; #else - char* skipstr; + WCHAR *skipstr; - skipstr = getenv ("TCL_TEMPLOAD_NO_UNLINK"); + skipstr = getenv("TCL_TEMPLOAD_NO_UNLINK"); if (skipstr && (skipstr[0] != '\0')) { return atoi(skipstr); } |
