summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-10-09 01:48:31 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-10-09 01:48:31 (GMT)
commit1061121812191fb6a50842007771b34c289131da (patch)
treed1beba8c0233d9c74a0c2a6b90e69e959f14636c /generic
parentc88725ffebf6be846bce8f33ddee5a39eea664a3 (diff)
parentcf9cce374ed8d3bc405f998d01d9965d224bc482 (diff)
downloadtcl-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')
-rw-r--r--generic/regc_locale.c4
-rw-r--r--generic/tclIO.c12
-rw-r--r--generic/tclIOSock.c15
-rw-r--r--generic/tclUtf.c3
4 files changed, 25 insertions, 9 deletions
diff --git a/generic/regc_locale.c b/generic/regc_locale.c
index 8591311b..f3db471 100644
--- a/generic/regc_locale.c
+++ b/generic/regc_locale.c
@@ -360,8 +360,8 @@ static const crange spaceRangeTable[] = {
#define NUM_SPACE_RANGE (sizeof(spaceRangeTable)/sizeof(crange))
static const chr spaceCharTable[] = {
- 0x20, 0x82, 0x83, 0x85, 0xa0, 0x1680, 0x180e, 0x2028, 0x2029,
- 0x202f, 0x205f, 0x2060, 0x3000, 0xfeff
+ 0x20, 0x85, 0xa0, 0x1680, 0x180e, 0x2028, 0x2029, 0x202f, 0x205f,
+ 0x2060, 0x3000, 0xfeff
};
#define NUM_SPACE_CHAR (sizeof(spaceCharTable)/sizeof(chr))
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 4e24533..0cb9fa9 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -879,19 +879,25 @@ CheckForStdChannelsBeingClosed(
ChannelState *statePtr = ((Channel *) chan)->state;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
- if ((chan == tsdPtr->stdinChannel) && tsdPtr->stdinInitialized) {
+ if (tsdPtr->stdinInitialized
+ && tsdPtr->stdinChannel != NULL
+ && statePtr == ((Channel *)tsdPtr->stdinChannel)->state) {
if (statePtr->refCount < 2) {
statePtr->refCount = 0;
tsdPtr->stdinChannel = NULL;
return;
}
- } else if ((chan == tsdPtr->stdoutChannel) && tsdPtr->stdoutInitialized) {
+ } else if (tsdPtr->stdoutInitialized
+ && tsdPtr->stdoutChannel != NULL
+ && statePtr == ((Channel *)tsdPtr->stdoutChannel)->state) {
if (statePtr->refCount < 2) {
statePtr->refCount = 0;
tsdPtr->stdoutChannel = NULL;
return;
}
- } else if ((chan == tsdPtr->stderrChannel) && tsdPtr->stderrInitialized) {
+ } else if (tsdPtr->stderrInitialized
+ && tsdPtr->stderrChannel != NULL
+ && statePtr == ((Channel *)tsdPtr->stderrChannel)->state) {
if (statePtr->refCount < 2) {
statePtr->refCount = 0;
tsdPtr->stderrChannel = NULL;
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;
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index d2bcc4c..4b5b37b 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -1516,8 +1516,7 @@ Tcl_UniCharIsSpace(
if (((Tcl_UniChar) ch) < ((Tcl_UniChar) 0x80)) {
return isspace(UCHAR(ch)); /* INTL: ISO space */
- } else if ((Tcl_UniChar) ch == 0x0082 || (Tcl_UniChar) ch == 0x0083
- || (Tcl_UniChar) ch == 0x0085 || (Tcl_UniChar) ch == 0x200b
+ } else if ((Tcl_UniChar) ch == 0x0085 || (Tcl_UniChar) ch == 0x200b
|| (Tcl_UniChar) ch == 0x2060 || (Tcl_UniChar) ch == 0xfeff) {
return 1;
} else {