summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rw-r--r--win/README2
-rwxr-xr-xwin/configure2
-rw-r--r--win/configure.in2
-rw-r--r--win/tclConfig.sh.in2
-rw-r--r--win/tclWinChan.c37
-rw-r--r--win/tclWinConsole.c2
-rw-r--r--win/tclWinFile.c24
-rw-r--r--win/tclWinSerial.c2
-rw-r--r--win/tclWinSock.c92
-rw-r--r--win/tclooConfig.sh2
-rw-r--r--win/tclsh.exe.manifest.in2
11 files changed, 86 insertions, 83 deletions
diff --git a/win/README b/win/README
index 1a2d501..5e060ef 100644
--- a/win/README
+++ b/win/README
@@ -79,7 +79,7 @@ Use the Makefile "install" target to install Tcl. It will install it
according to the prefix options you provided in the correct directory
structure.
-Note that in order to run tclsh85.exe, you must ensure that tcl85.dll is
+Note that in order to run tclsh86.exe, you must ensure that tcl86.dll is
on your path, in the system directory, or in the directory containing
tclsh86.exe.
diff --git a/win/configure b/win/configure
index cf2b201..b270648 100755
--- a/win/configure
+++ b/win/configure
@@ -1311,7 +1311,7 @@ SHELL=/bin/sh
TCL_VERSION=8.6
TCL_MAJOR_VERSION=8
TCL_MINOR_VERSION=6
-TCL_PATCH_LEVEL=".2"
+TCL_PATCH_LEVEL=".3"
VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
TCL_DDE_VERSION=1.4
diff --git a/win/configure.in b/win/configure.in
index aa47505..1bf901a 100644
--- a/win/configure.in
+++ b/win/configure.in
@@ -14,7 +14,7 @@ SHELL=/bin/sh
TCL_VERSION=8.6
TCL_MAJOR_VERSION=8
TCL_MINOR_VERSION=6
-TCL_PATCH_LEVEL=".2"
+TCL_PATCH_LEVEL=".3"
VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
TCL_DDE_VERSION=1.4
diff --git a/win/tclConfig.sh.in b/win/tclConfig.sh.in
index 00a8790..75324b2 100644
--- a/win/tclConfig.sh.in
+++ b/win/tclConfig.sh.in
@@ -1,5 +1,5 @@
# tclConfig.sh --
-#
+#
# This shell script (for sh) is generated automatically by Tcl's
# configure script. It will create shell variables for most of
# the configuration options discovered by the configure script.
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index 48acacb..cca0dab 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -843,6 +843,11 @@ TclpOpenFileChannel(
nativeName = Tcl_FSGetNativePath(pathPtr);
if (nativeName == NULL) {
+ if (interp != (Tcl_Interp *) NULL) {
+ Tcl_AppendResult(interp, "couldn't open \"",
+ TclGetString(pathPtr), "\": filename is invalid on this platform",
+ NULL);
+ }
return NULL;
}
@@ -966,7 +971,7 @@ TclpOpenFileChannel(
switch (FileGetType(handle)) {
case FILE_TYPE_SERIAL:
/*
- * Natively named serial ports "com1-9", "\\\\.\\comXX" are
+ * Natively named serial ports "com1-9", "\\\\.\\comXX" are
* already done with the code above.
* Here we handle all other serial port names.
*
@@ -1520,12 +1525,11 @@ FileGetType(
* NativeIsComPort --
*
* Determines if a path refers to a Windows serial port.
- * A simple and efficient solution is to use a "name hint" to detect
- * COM ports by their filename instead of resorting to a syscall
+ * A simple and efficient solution is to use a "name hint" to detect
+ * COM ports by their filename instead of resorting to a syscall
* to detect serialness after the fact.
* The following patterns cover common serial port names:
- * COM[1-9]:?
- * //./COM[0-9]+
+ * COM[1-9]
* \\.\COM[0-9]+
*
* Results:
@@ -1545,33 +1549,26 @@ NativeIsComPort(
* 1. Look for com[1-9]:?
*/
- if ( (len >= 4) && (len <= 5)
- && (_wcsnicmp(p, L"com", 3) == 0) ) {
+ if ( (len == 4) && (_wcsnicmp(p, L"com", 3) == 0) ) {
/*
- * The 4th character must be a digit 1..9 optionally followed by a ":"
+ * The 4th character must be a digit 1..9
*/
-
+
if ( (p[3] < L'1') || (p[3] > L'9') ) {
return 0;
}
- if ( (len == 5) && (p[4] != L':') ) {
- return 0;
- }
return 1;
}
-
+
/*
- * 2. Look for //./com[0-9]+ or \\.\com[0-9]+
+ * 2. Look for \\.\com[0-9]+
*/
-
- if ( (len >= 8) && (
- (_wcsnicmp(p, L"//./com", 7) == 0)
- || (_wcsnicmp(p, L"\\\\.\\com", 7) == 0) ) )
- {
+
+ if ((len >= 8) && (_wcsnicmp(p, L"\\\\.\\com", 7) == 0)) {
/*
* Charaters 8..end must be a digits 0..9
*/
-
+
for ( i=7; i<len; i++ ) {
if ( (p[i] < '0') || (p[i] > '9') ) {
return 0;
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index 6630083..63150ef 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -761,7 +761,7 @@ ConsoleInputProc(
* by the caller. In practice this is harmless, since all writes
* are into ChannelBuffers, and those have padding, but still
* ought to remove this, unless some Windows wizard can give
- * a reason not to.
+ * a reason not to.
*/
buf[count] = '\0';
return count;
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index fe84a26..d6ca348 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -1241,9 +1241,9 @@ WinIsReserved(
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') {
@@ -1262,9 +1262,9 @@ WinIsReserved(
} 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') {
@@ -2933,18 +2933,22 @@ TclNativeCreateNativeRep(
/* String contains NUL-bytes. This is invalid. */
return 0;
}
- /* Let MultiByteToWideChar check for other invalid sequences, like
- * 0xC0 0x80 (== overlong NUL). See bug [3118489]: NUL in filenames */
- len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, 0, 0);
- if (len==0) {
- return 0;
+ /* For a reserved device, strip a possible postfix ':' */
+ len = WinIsReserved(str);
+ if (len == 0) {
+ /* Let MultiByteToWideChar check for other invalid sequences, like
+ * 0xC0 0x80 (== overlong NUL). See bug [3118489]: NUL in filenames */
+ len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, 0, 0);
+ if (len==0) {
+ return 0;
+ }
}
/* Overallocate 6 chars, making some room for extended paths */
wp = nativePathPtr = ckalloc( (len+6) * sizeof(WCHAR) );
if (nativePathPtr==0) {
return 0;
}
- MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nativePathPtr, len);
+ MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, nativePathPtr, len+1);
/*
** If path starts with "//?/" or "\\?\" (extended path), translate
** any slashes to backslashes but leave the '?' intact
diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c
index 6487fe4..0730a46 100644
--- a/win/tclWinSerial.c
+++ b/win/tclWinSerial.c
@@ -1415,7 +1415,7 @@ SerialWriterThread(
* Opens or Reopens the serial port with the OVERLAPPED FLAG set
*
* Results:
- * Returns the new handle, or INVALID_HANDLE_VALUE.
+ * Returns the new handle, or INVALID_HANDLE_VALUE.
* If an existing channel is specified it is closed and reopened.
*
* Side effects:
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 900f7c4..a022ed5 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -596,7 +596,7 @@ WaitForConnect(
/*
* Check if an async connect is running. If not return ok
*/
-
+
if (!(statePtr->flags & TCP_ASYNC_CONNECT)) {
return 0;
}
@@ -616,7 +616,7 @@ WaitForConnect(
/* get statePtr lock */
tsdPtr = TclThreadDataKeyGet(&dataKey);
WaitForSingleObject(tsdPtr->socketListLock, INFINITE);
-
+
/* Check for connect event */
if (statePtr->readyEvents & FD_CONNECT) {
@@ -1250,7 +1250,7 @@ TcpGetOptionProc(
return TCL_ERROR;
}
- /*
+ /*
* Go one step in async connect
* If any error is thrown save it as backround error to report eventually below
*/
@@ -1647,14 +1647,14 @@ TcpConnect(
/* We were called by the event procedure and continue our loop */
int async_callback = statePtr->flags & TCP_ASYNC_PENDING;
ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey);
-
+
if (async_callback) {
goto reenter;
}
-
+
for (statePtr->addr = statePtr->addrlist; statePtr->addr != NULL;
statePtr->addr = statePtr->addr->ai_next) {
-
+
for (statePtr->myaddr = statePtr->myaddrlist; statePtr->myaddr != NULL;
statePtr->myaddr = statePtr->myaddr->ai_next) {
@@ -1670,7 +1670,7 @@ TcpConnect(
/*
* Close the socket if it is still open from the last unsuccessful
* iteration.
- */
+ */
if (statePtr->sockets->fd != INVALID_SOCKET) {
closesocket(statePtr->sockets->fd);
}
@@ -1683,9 +1683,9 @@ TcpConnect(
*/
statePtr->notifierConnectError = 0;
Tcl_SetErrno(0);
-
+
statePtr->sockets->fd = socket(statePtr->myaddr->ai_family, SOCK_STREAM, 0);
-
+
/* Free list lock */
SetEvent(tsdPtr->socketListLock);
@@ -1739,7 +1739,7 @@ TcpConnect(
*/
for (statePtr2 = tsdPtr->socketList; statePtr2 != NULL;
- statePtr2 = statePtr->nextPtr) {
+ statePtr2 = statePtr2->nextPtr) {
if (statePtr2 == statePtr) {
in_socket_list = 1;
break;
@@ -1754,7 +1754,7 @@ TcpConnect(
* thread.
*/
statePtr->selectEvents |= FD_CONNECT;
-
+
/*
* Free list lock
*/
@@ -1768,7 +1768,7 @@ TcpConnect(
/*
* Attempt to connect to the remote socket.
*/
-
+
connect(statePtr->sockets->fd, statePtr->addr->ai_addr,
statePtr->addr->ai_addrlen);
@@ -1809,7 +1809,7 @@ TcpConnect(
* the FD_CONNECT asyncroneously
*/
tsdPtr->pendingTcpState = NULL;
-
+
if (Tcl_GetErrno() == 0) {
goto out;
}
@@ -1835,12 +1835,12 @@ out:
* Set up the select mask for read/write events.
*/
statePtr->selectEvents = FD_READ | FD_WRITE | FD_CLOSE;
-
+
/*
* Register for interest in events in the select mask. Note that this
* automatically places the socket into non-blocking mode.
*/
-
+
SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT,
(LPARAM) statePtr);
} else {
@@ -2092,20 +2092,20 @@ Tcl_OpenTcpServer(
TclWinConvertError((DWORD) WSAGetLastError());
continue;
}
-
+
/*
* Win-NT has a misfeature that sockets are inherited in child
* processes by default. Turn off the inherit bit.
*/
-
+
SetHandleInformation((HANDLE) sock, HANDLE_FLAG_INHERIT, 0);
-
+
/*
* Set kernel space buffering
*/
-
+
TclSockMinimumBuffers((void *)sock, TCP_BUFFER_SIZE);
-
+
/*
* Make sure we use the same port when opening two server sockets
* for IPv4 and IPv6.
@@ -2113,12 +2113,12 @@ Tcl_OpenTcpServer(
* As sockaddr_in6 uses the same offset and size for the port
* member as sockaddr_in, we can handle both through the IPv4 API.
*/
-
+
if (port == 0 && chosenport != 0) {
((struct sockaddr_in *) addrPtr->ai_addr)->sin_port =
htons(chosenport);
}
-
+
/*
* Bind to the specified port. Note that we must not call
* setsockopt with SO_REUSEADDR because Microsoft allows addresses
@@ -2128,7 +2128,7 @@ Tcl_OpenTcpServer(
* set into nonblocking mode. If there is trouble, this is one
* place to look for bugs.
*/
-
+
if (bind(sock, addrPtr->ai_addr, addrPtr->ai_addrlen)
== SOCKET_ERROR) {
TclWinConvertError((DWORD) WSAGetLastError());
@@ -2138,29 +2138,29 @@ Tcl_OpenTcpServer(
if (port == 0 && chosenport == 0) {
address sockname;
socklen_t namelen = sizeof(sockname);
-
+
/*
* Synchronize port numbers when binding to port 0 of multiple
* addresses.
*/
-
+
if (getsockname(sock, &sockname.sa, &namelen) >= 0) {
chosenport = ntohs(sockname.sa4.sin_port);
}
}
-
+
/*
* Set the maximum number of pending connect requests to the max
* value allowed on each platform (Win32 and Win32s may be
* different, and there may be differences between TCP/IP stacks).
*/
-
+
if (listen(sock, SOMAXCONN) == SOCKET_ERROR) {
TclWinConvertError((DWORD) WSAGetLastError());
closesocket(sock);
continue;
}
-
+
if (statePtr == NULL) {
/*
* Add this socket to the global list of sockets.
@@ -2186,9 +2186,9 @@ error:
/*
* Set up the select mask for connection request events.
*/
-
+
statePtr->selectEvents = FD_ACCEPT;
-
+
/*
* Register for interest in events in the select mask. Note that this
* automatically places the socket into non-blocking mode.
@@ -2652,7 +2652,7 @@ SocketEventProc(
WaitForConnect(statePtr,NULL);
} else {
-
+
/*
* No async connect reenter pending. Just clear event.
*/
@@ -2681,7 +2681,7 @@ SocketEventProc(
* network stack conditions that can result in FD_ACCEPT but a subsequent
* failure on accept() by the time we get around to it.
* Access to sockets (acceptEventCount, readyEvents) in socketList
- * is still protected by the lock (prevents reintroduction of
+ * is still protected by the lock (prevents reintroduction of
* SF Tcl Bug 3056775.
*/
@@ -2713,9 +2713,9 @@ SocketEventProc(
return 1;
}
- /* Loop terminated with no sockets accepted; clear the ready mask so
- * we can detect the next connection request. Note that connection
- * requests are level triggered, so if there is a request already
+ /* Loop terminated with no sockets accepted; clear the ready mask so
+ * we can detect the next connection request. Note that connection
+ * requests are level triggered, so if there is a request already
* pending, a new event will be generated.
*/
statePtr->acceptEventCount = 0;
@@ -2758,7 +2758,7 @@ SocketEventProc(
if ( statePtr->flags & TCP_ASYNC_FAILED ) {
mask |= TCL_READABLE;
-
+
} else {
fd_set readFds;
struct timeval timeout;
@@ -2796,11 +2796,11 @@ SocketEventProc(
if (events & FD_WRITE) {
mask |= TCL_WRITABLE;
}
-
+
/*
* Call registered event procedures
*/
-
+
if (mask) {
Tcl_NotifyChannel(statePtr->channel, mask);
}
@@ -2812,7 +2812,7 @@ SocketEventProc(
*
* AddSocketInfoFd --
*
- * This function adds a SOCKET file descriptor to the 'sockets' linked
+ * This function adds a SOCKET file descriptor to the 'sockets' linked
* list of a TcpState structure.
*
* Results:
@@ -2826,7 +2826,7 @@ SocketEventProc(
static void
AddSocketInfoFd(
- TcpState *statePtr,
+ TcpState *statePtr,
SOCKET socket)
{
TcpFdList *fds = statePtr->sockets;
@@ -2840,7 +2840,7 @@ AddSocketInfoFd(
while ( fds->next != NULL ) {
fds = fds->next;
}
-
+
fds->next = ckalloc(sizeof(TcpFdList));
fds = fds->next;
}
@@ -2851,7 +2851,7 @@ AddSocketInfoFd(
fds->next = NULL;
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -2935,7 +2935,7 @@ WaitForSocketEvent(
/* get statePtr lock */
WaitForSingleObject(tsdPtr->socketListLock, INFINITE);
-
+
/* Check if event occured */
event_found = (statePtr->readyEvents & events);
@@ -2946,7 +2946,7 @@ WaitForSocketEvent(
if (event_found) {
break;
}
-
+
/* Exit loop if event did not occur but this is a non-blocking channel */
if (statePtr->flags & TCP_NONBLOCKING) {
*errorCodePtr = EWOULDBLOCK;
@@ -3313,11 +3313,11 @@ TcpThreadActionProc(
WaitForSingleObject(tsdPtr->socketListLock, INFINITE);
statePtr->nextPtr = tsdPtr->socketList;
tsdPtr->socketList = statePtr;
-
+
if (statePtr == tsdPtr->pendingTcpState) {
tsdPtr->pendingTcpState = NULL;
}
-
+
SetEvent(tsdPtr->socketListLock);
notifyCmd = SELECT;
diff --git a/win/tclooConfig.sh b/win/tclooConfig.sh
index 14b0d8d..55fe75f 100644
--- a/win/tclooConfig.sh
+++ b/win/tclooConfig.sh
@@ -16,4 +16,4 @@ TCLOO_STUB_LIB_SPEC=""
TCLOO_INCLUDE_SPEC=""
TCLOO_PRIVATE_INCLUDE_SPEC=""
TCLOO_CFLAGS=""
-TCLOO_VERSION=1.0.2
+TCLOO_VERSION=1.0.3
diff --git a/win/tclsh.exe.manifest.in b/win/tclsh.exe.manifest.in
index b7c4381..8b06fce 100644
--- a/win/tclsh.exe.manifest.in
+++ b/win/tclsh.exe.manifest.in
@@ -20,6 +20,8 @@
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
+ <!-- Windows 10 -->
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->