34 lines
1.1 KiB
Diff
34 lines
1.1 KiB
Diff
diff -urN a/Modules/getpath.c b/Modules/getpath.c
|
|
--- a/Modules/getpath.c 2014-10-11 22:42:58.511924000 +0100
|
|
+++ b/Modules/getpath.c 2014-10-11 22:43:01.444091800 +0100
|
|
@@ -726,6 +726,29 @@
|
|
}
|
|
else
|
|
strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
|
|
+#ifdef MS_WINDOWS
|
|
+ if (path) {
|
|
+ /* Add path of executable/dll to system path. This
|
|
+ * is so that the correct tcl??.dll and tk??.dll get
|
|
+ * used. */
|
|
+ char *module_path = dllpath[0] ? dllpath : progpath;
|
|
+ char *new_path = alloca(strlen("PATH=")+strlen(module_path)+1+strlen(path)+1);
|
|
+ if (new_path) {
|
|
+ strcpy( new_path, "PATH=" );
|
|
+ strcat( new_path, module_path );
|
|
+ char *slashes = strchr( new_path, '/' );
|
|
+ while (slashes) {
|
|
+ *slashes = '\\';
|
|
+ slashes = strchr( slashes+1, '/' );
|
|
+ }
|
|
+ char *end = strrchr(new_path, '\\') ? strrchr(new_path, '\\') : new_path + strlen(new_path);
|
|
+ end[0] = ';';
|
|
+ end[1] = '\0';
|
|
+ strcat( new_path, path );
|
|
+ _putenv( new_path );
|
|
+ }
|
|
+ }
|
|
+#endif
|
|
}
|
|
|
|
|