diff options
author | dgp <dgp@users.sourceforge.net> | 2007-11-27 20:38:40 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2007-11-27 20:38:40 (GMT) |
commit | 2bb4594876511ab2fa53c367f2677f9105fe7bb2 (patch) | |
tree | 6c58f55ad528478a31a1d97a73c8a533a6dfea00 /win | |
parent | b65175e0556b45c22a1e5b702ad58b49d436e5b9 (diff) | |
download | tcl-2bb4594876511ab2fa53c367f2677f9105fe7bb2.zip tcl-2bb4594876511ab2fa53c367f2677f9105fe7bb2.tar.gz tcl-2bb4594876511ab2fa53c367f2677f9105fe7bb2.tar.bz2 |
* win/tclWinSock.c: Add mising encoding conversion of the [info
hostname] value from the system encoding to Tcl's internal encoding.
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinSock.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c index d46bfc0..1d61eb6 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinSock.c,v 1.57 2007/02/20 23:24:07 nijtmans Exp $ + * RCS: @(#) $Id: tclWinSock.c,v 1.58 2007/11/27 20:38:40 dgp Exp $ */ #include "tclWinInt.h" @@ -2576,13 +2576,18 @@ InitializeHostName( * Maintainers are welcome to supply it. */ - Tcl_DStringSetLength(&ds, 255); - if (winSock.gethostname(Tcl_DStringValue(&ds), - Tcl_DStringLength(&ds)) == 0) { + Tcl_DString inDs; + + Tcl_DStringInit(&inDs); + Tcl_DStringSetLength(&inDs, 255); + if (winSock.gethostname(Tcl_DStringValue(&inDs), + Tcl_DStringLength(&inDs)) == 0) { Tcl_DStringSetLength(&ds, 0); } else { - Tcl_DStringSetLength(&ds, strlen(Tcl_DStringValue(&ds))); + Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&inDs), + Tcl_DStringLength(&inDs), &ds); } + Tcl_DStringFree(&inDs); } } |