summaryrefslogtreecommitdiffstats
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)
commit63e3c5ca66470ba1f461055790abad3131092b0a (patch)
treec278cd470961efab9958d2fc4f1e40c779ba20c8
parenta6573529e52eff368bc5f159290de355ab90ab78 (diff)
parent32dda4af9bc7d9e23f8dc6722d26609e4714a470 (diff)
downloadtcl-63e3c5ca66470ba1f461055790abad3131092b0a.zip
tcl-63e3c5ca66470ba1f461055790abad3131092b0a.tar.gz
tcl-63e3c5ca66470ba1f461055790abad3131092b0a.tar.bz2
cygwin should use SetEnvironmentVariable for windows envcygwin_environment_changes
-rw-r--r--generic/tcl.decls4
-rw-r--r--generic/tclEnv.c15
-rw-r--r--generic/tclPort.h7
3 files changed, 9 insertions, 17 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 70e848f..8355d99 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -774,10 +774,10 @@ declare 216 {
declare 217 {
void Tcl_ResetResult(Tcl_Interp *interp)
}
-declare 218 generic {
+declare 218 {
int Tcl_ScanElement(const char *src, int *flagPtr)
}
-declare 219 generic {
+declare 219 {
int Tcl_ScanCountedElement(const char *src, int length, int *flagPtr)
}
# Obsolete
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__ */
diff --git a/generic/tclPort.h b/generic/tclPort.h
index 23c6191..79bea88 100644
--- a/generic/tclPort.h
+++ b/generic/tclPort.h
@@ -29,10 +29,13 @@
# define USE_PUTENV 1
# define USE_PUTENV_FOR_UNSET 1
/* On Cygwin, the environment is imported from the Cygwin DLL. */
- DLLIMPORT extern char **__cygwin_environ;
- DLLIMPORT extern int cygwin_conv_to_win32_path(const char *, char *);
# define environ __cygwin_environ
# define timezone _timezone
+ DLLIMPORT extern char **__cygwin_environ;
+ DLLIMPORT extern int cygwin_conv_to_win32_path(const char *, char *);
+ 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);
+ DLLIMPORT extern void __stdcall SetEnvironmentVariableA(const char*, const char *);
#endif
#if !defined(LLONG_MIN)