57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
#endif
if (tclNativeExecutableName != NULL) {
return tclNativeExecutableName;
}
#ifdef __CYGWIN__
/* Make some symbols available without including <windows.h> */
# define CP_UTF8 65001
extern int cygwin_conv_to_full_posix_path(const char *, char *);
extern __stdcall int GetModuleFileNameW(void *, const char *, int);
extern __stdcall int WideCharToMultiByte(int, int, const char *, int,
const char *, int, const char *, const char *);
GetModuleFileNameW(NULL, name, PATH_MAX);
WideCharToMultiByte(CP_UTF8, 0, name, -1, buf, PATH_MAX, NULL, NULL);
cygwin_conv_to_full_posix_path(buf, name);
length = strlen(name);
if ((length > 4) && !strcasecmp(name + length - 4, ".exe")) {
/* Strip '.exe' part. */
length -= 4;
|
<
<
<
<
<
<
<
<
|
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#endif
if (tclNativeExecutableName != NULL) {
return tclNativeExecutableName;
}
#ifdef __CYGWIN__
GetModuleFileNameW(NULL, name, PATH_MAX);
WideCharToMultiByte(CP_UTF8, 0, name, -1, buf, PATH_MAX, NULL, NULL);
cygwin_conv_to_full_posix_path(buf, name);
length = strlen(name);
if ((length > 4) && !strcasecmp(name + length - 4, ".exe")) {
/* Strip '.exe' part. */
length -= 4;
|