diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-28 19:59:10 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-28 19:59:10 (GMT) |
commit | e53523e7b878272b5562743d35dfd83cc3c80500 (patch) | |
tree | c177b306cc7eabdede0019b7baa94421273e2a89 /unix/tclUnixFile.c | |
parent | 93a473b9ee7e8c4bf201f503714515b25984b7ef (diff) | |
parent | 024c0f6699f2ffffd1ac1d5e82c7c9d861deb9c7 (diff) | |
download | tcl-e53523e7b878272b5562743d35dfd83cc3c80500.zip tcl-e53523e7b878272b5562743d35dfd83cc3c80500.tar.gz tcl-e53523e7b878272b5562743d35dfd83cc3c80500.tar.bz2 |
merge trunk
bug fix: variable $key not found
make it work on cygwin as well
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r-- | unix/tclUnixFile.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index edd0d2f..4a34b0b 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -42,19 +42,18 @@ TclpFindExecutable( Tcl_Encoding encoding; #ifdef __CYGWIN__ int length; - char buf[PATH_MAX * TCL_UTF_MAX + 1]; + char buf[PATH_MAX * 2]; char name[PATH_MAX * TCL_UTF_MAX + 1]; - GetModuleFileNameW(NULL, name, PATH_MAX); - WideCharToMultiByte(CP_UTF8, 0, name, -1, buf, PATH_MAX, NULL, NULL); - cygwin_conv_to_full_posix_path(buf, name); + GetModuleFileNameW(NULL, buf, PATH_MAX); + cygwin_conv_path(3, buf, name, PATH_MAX); length = strlen(name); if ((length > 4) && !strcasecmp(name + length - 4, ".exe")) { /* Strip '.exe' part. */ length -= 4; } - encoding = Tcl_GetEncoding(NULL, NULL); - TclSetObjNameOfExecutable( - Tcl_NewStringObj(name, length), encoding); + encoding = Tcl_GetEncoding(NULL, NULL); + TclSetObjNameOfExecutable( + Tcl_NewStringObj(name, length), encoding); #else const char *name, *p; Tcl_StatBuf statBuf; |