summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c40
-rw-r--r--generic/tclFileName.c8
-rw-r--r--generic/tclIOSock.c23
3 files changed, 28 insertions, 43 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index acb6bf1..337a75f 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -80,40 +80,8 @@ int tclTraceExec = 0;
*/
static const char *const operatorStrings[] = {
- "||", /* 0 */
- "&&", /* 1 */
- "|", /* 2 */
- "^", /* 3 */
- "&", /* 4 */
- "==", /* 5 */
- "!=", /* 6 */
- "<", /* 7 */
- ">", /* 8 */
- "<=", /* 9 */
- ">=", /* 10 */
- "<<", /* 11 */
- ">>", /* 12 */
- "+", /* 13 */
- "-", /* 14 */
- "*", /* 15 */
- "/", /* 16 */
- "%", /* 17 */
- "+", /* 18 */
- "-", /* 19 */
- "~", /* 20 */
- "!", /* 21 */
- "BUILTIN FUNCTION", /* 22 */
- "FUNCTION", /* 23 */
- "", /* 24 */
- "", /* 25 */
- "", /* 26 */
- "", /* 27 */
- "", /* 28 */
- "", /* 29 */
- "", /* 30 */
- "", /* 31 */
- "eq", /* 32 */
- "ne" /* 33 */
+ "||", "&&", "|", "^", "&", "==", "!=", "<", ">", "<=", ">=", "<<", ">>",
+ "+", "-", "*", "/", "%", "+", "-", "~", "!"
};
/*
@@ -9860,8 +9828,8 @@ IllegalExprOperandType(
if (opcode == INST_EXPON) {
operator = "**";
- } else if (opcode <= INST_STR_NEQ) {
- operator = operatorStrings[opcode - INST_LOR -1];
+ } else if (opcode <= INST_LNOT) {
+ operator = operatorStrings[opcode - INST_LOR];
}
if (GetNumberFromObj(NULL, opndPtr, &ptr, &type) != TCL_OK) {
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 5d4702b..a7251bb 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -235,9 +235,9 @@ ExtractWinRoot(
if ((path[0] == 'c' || path[0] == 'C')
&& (path[1] == 'o' || path[1] == 'O')) {
if ((path[2] == 'm' || path[2] == 'M')
- && path[3] >= '1' && path[3] <= '4') {
+ && path[3] >= '1' && path[3] <= '9') {
/*
- * May have match for 'com[1-4]:?', which is a serial port.
+ * May have match for 'com[1-9]:?', which is a serial port.
*/
if (path[4] == '\0') {
@@ -257,9 +257,9 @@ ExtractWinRoot(
} else if ((path[0] == 'l' || path[0] == 'L')
&& (path[1] == 'p' || path[1] == 'P')
&& (path[2] == 't' || path[2] == 'T')) {
- if (path[3] >= '1' && path[3] <= '3') {
+ if (path[3] >= '1' && path[3] <= '9') {
/*
- * May have match for 'lpt[1-3]:?'
+ * May have match for 'lpt[1-9]:?'
*/
if (path[4] == '\0') {
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c
index 694501f..f69d30f 100644
--- a/generic/tclIOSock.c
+++ b/generic/tclIOSock.c
@@ -12,9 +12,26 @@
#include "tclInt.h"
#if defined(_WIN32) && defined(UNICODE)
-/* On Windows, we always need the ASCII version. */
-# undef gai_strerror
-# define gai_strerror gai_strerrorA
+/* On Windows, we need to do proper Unicode->UTF-8 conversion. */
+
+typedef struct ThreadSpecificData {
+ int initialized;
+ Tcl_DString errorMsg; /* UTF-8 encoded error-message */
+} ThreadSpecificData;
+static Tcl_ThreadDataKey dataKey;
+
+#undef gai_strerror
+static const char *gai_strerror(int code) {
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ if (tsdPtr->initialized) {
+ Tcl_DStringFree(&tsdPtr->errorMsg);
+ } else {
+ tsdPtr->initialized = 1;
+ }
+ Tcl_WinTCharToUtf(gai_strerrorW(code), -1, &tsdPtr->errorMsg);
+ return Tcl_DStringValue(&tsdPtr->errorMsg);
+}
#endif
/*