summaryrefslogtreecommitdiffstats
path: root/win/tclWinInit.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-25 20:38:16 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-25 20:38:16 (GMT)
commitfdee46ab16b879589155729e6db4fdabe235880f (patch)
treeba7a7a4cc25027d8df81784b5a53e2add157f47b /win/tclWinInit.c
parent94f9cf81ed3e156bd372a3cac249974d1acb4e1d (diff)
parent0839047d8bed631eeb82c7c3e26b0f13461717e6 (diff)
downloadtcl-fdee46ab16b879589155729e6db4fdabe235880f.zip
tcl-fdee46ab16b879589155729e6db4fdabe235880f.tar.gz
tcl-fdee46ab16b879589155729e6db4fdabe235880f.tar.bz2
merge 8.6
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r--win/tclWinInit.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index b77a580..f04069b 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -107,7 +107,12 @@ static ProcessGlobalValue sourceLibraryDir =
{0, 0, NULL, NULL, InitializeSourceLibraryDir, NULL, NULL};
static void AppendEnvironment(Tcl_Obj *listPtr, const char *lib);
-static int ToUtf(const WCHAR *wSrc, char *dst);
+
+#if TCL_UTF_MAX < 4
+static void ToUtf(const WCHAR *wSrc, char *dst);
+#else
+#define ToUtf(wSrc, dst) WideCharToMultiByte(CP_UTF8, 0, wSrc, -1, dst, MAX_PATH * TCL_UTF_MAX, NULL, NULL)
+#endif
/*
*---------------------------------------------------------------------------
@@ -431,7 +436,7 @@ InitializeSourceLibraryDir(
*
* ToUtf --
*
- * Convert a char string to a UTF string.
+ * Convert a wchar string to a UTF string.
*
* Results:
* None.
@@ -442,21 +447,19 @@ InitializeSourceLibraryDir(
*---------------------------------------------------------------------------
*/
-static int
+#if TCL_UTF_MAX < 4
+static void
ToUtf(
const WCHAR *wSrc,
char *dst)
{
- char *start;
-
- start = dst;
while (*wSrc != '\0') {
dst += Tcl_UniCharToUtf(*wSrc, dst);
wSrc++;
}
*dst = '\0';
- return (int) (dst - start);
}
+#endif
/*
*---------------------------------------------------------------------------
@@ -646,7 +649,7 @@ TclpSetVariables(
* TclpFindVariable --
*
* Locate the entry in environ for a given name. On Unix this routine is
- * case sensitive, on Windows this matches mioxed case.
+ * case sensitive, on Windows this matches mixed case.
*
* Results:
* The return value is the index in environ of an entry with the name