diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-10-09 01:48:31 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-10-09 01:48:31 (GMT) |
commit | 1061121812191fb6a50842007771b34c289131da (patch) | |
tree | d1beba8c0233d9c74a0c2a6b90e69e959f14636c /generic/tclIOSock.c | |
parent | c88725ffebf6be846bce8f33ddee5a39eea664a3 (diff) | |
parent | cf9cce374ed8d3bc405f998d01d9965d224bc482 (diff) | |
download | tcl-1061121812191fb6a50842007771b34c289131da.zip tcl-1061121812191fb6a50842007771b34c289131da.tar.gz tcl-1061121812191fb6a50842007771b34c289131da.tar.bz2 |
merge trunk
<p>Dont include U+0082 and U+0083 in the Tcl space set
Diffstat (limited to 'generic/tclIOSock.c')
-rw-r--r-- | generic/tclIOSock.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index e603c91..694501f 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -151,7 +151,7 @@ TclCreateSocketAddress( struct addrinfo *p; struct addrinfo *v4head = NULL, *v4ptr = NULL; struct addrinfo *v6head = NULL, *v6ptr = NULL; - char *native = NULL, portstring[TCL_INTEGER_SPACE]; + char *native = NULL, portbuf[TCL_INTEGER_SPACE], *portstring; const char *family = NULL; Tcl_DString ds; int result, i; @@ -159,7 +159,18 @@ TclCreateSocketAddress( if (host != NULL) { native = Tcl_UtfToExternalDString(NULL, host, -1, &ds); } - TclFormatInt(portstring, port); + + /* + * Workaround for OSX's apparent inability to resolve "localhost", "0" + * when the loopback device is the only available network interface. + */ + if (host != NULL && port == 0) { + portstring = NULL; + } else { + TclFormatInt(portbuf, port); + portstring = portbuf; + } + (void) memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; |