summaryrefslogtreecommitdiffstats
path: root/generic/tclEnv.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-06 23:42:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-06 23:42:37 (GMT)
commit2273ceb49e50f4be5b0da0367fb44bde6466d720 (patch)
treec278cd470961efab9958d2fc4f1e40c779ba20c8 /generic/tclEnv.c
parentee78c66928baca5068946e847951c4bfbb34ad81 (diff)
parent7c71d5645fb9359ded5350f20396923f164a735a (diff)
downloadtcl-2273ceb49e50f4be5b0da0367fb44bde6466d720.zip
tcl-2273ceb49e50f4be5b0da0367fb44bde6466d720.tar.gz
tcl-2273ceb49e50f4be5b0da0367fb44bde6466d720.tar.bz2
cygwin should use SetEnvironmentVariable for windows env
Diffstat (limited to 'generic/tclEnv.c')
-rw-r--r--generic/tclEnv.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index 980a785..72d6fba 100644
--- a/generic/tclEnv.c
+++ b/generic/tclEnv.c
@@ -45,11 +45,8 @@ MODULE_SCOPE void TclSetEnv(const char *name, const char *value);
MODULE_SCOPE void TclUnsetEnv(const char *name);
#if defined(__CYGWIN__)
-/* On Cygwin, the environment is imported from the Cygwin DLL. */
- DLLIMPORT extern int cygwin_posix_to_win32_path_list_buf_size(char *value);
- DLLIMPORT extern void cygwin_posix_to_win32_path_list(char *buf, char *value);
-# define putenv TclCygwinPutenv
-static void TclCygwinPutenv(char *string);
+ static void TclCygwinPutenv(char *string);
+# define putenv TclCygwinPutenv
#endif
/*
@@ -754,15 +751,11 @@ TclCygwinPutenv(
*/
if (strcmp(name, "Path") == 0) {
-#ifdef __WIN32__
SetEnvironmentVariableA("PATH", NULL);
-#endif
unsetenv("PATH");
}
-#ifdef __WIN32__
SetEnvironmentVariableA(name, value);
-#endif
} else {
char *buf;
@@ -770,9 +763,7 @@ TclCygwinPutenv(
* Eliminate any Path variable, to prevent any confusion.
*/
-#ifdef __WIN32__
SetEnvironmentVariableA("Path", NULL);
-#endif
unsetenv("Path");
if (value == NULL) {
@@ -785,9 +776,7 @@ TclCygwinPutenv(
cygwin_posix_to_win32_path_list(value, buf);
}
-#ifdef __WIN32__
SetEnvironmentVariableA(name, buf);
-#endif
}
}
#endif /* __CYGWIN__ */