summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-03-07 07:58:39 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-03-07 07:58:39 (GMT)
commitfa0f595cf9f339ac2922ffea021e3763df775cb8 (patch)
treef7c78a5603f8828b41548673e728506b44ffc0f8
parent1d47b2fc79eb8184485753b3ff7230f6426a0306 (diff)
downloadtcl-fa0f595cf9f339ac2922ffea021e3763df775cb8.zip
tcl-fa0f595cf9f339ac2922ffea021e3763df775cb8.tar.gz
tcl-fa0f595cf9f339ac2922ffea021e3763df775cb8.tar.bz2
Fix [9471e6e304]: InitWinEnv not thread safe
-rw-r--r--generic/tclEnv.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index 40ced17..b001153 100644
--- a/generic/tclEnv.c
+++ b/generic/tclEnv.c
@@ -135,6 +135,18 @@ TclSetupEnv(
}
p2++;
p2[-1] = '\0';
+#if defined(_WIN32)
+ /*
+ * Enforce PATH and COMSPEC to be all uppercase. This eliminates
+ * additional trace logic otherwise required in init.tcl.
+ */
+
+ if (strcasecmp(p1, "PATH") == 0) {
+ p1 = "PATH";
+ } else if (strcasecmp(p1, "COMSPEC") == 0) {
+ p1 = "COMSPEC";
+ }
+#endif
obj1 = Tcl_NewStringObj(p1, -1);
obj2 = Tcl_NewStringObj(p2, -1);
Tcl_DStringFree(&envString);