diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-14 21:52:20 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-09-14 21:52:20 (GMT) |
commit | c9396a84a899e88fa02dd17df5601e9b2fd0cef4 (patch) | |
tree | 7188f5fa190c980eee21173bf1c5a8b807398002 | |
parent | 96c82a32e19afd4581f3aa21da39c8c6aa90bd7c (diff) | |
parent | 93022718af12833e135ad743bc6169bcfd443ddf (diff) | |
download | tcl-c9396a84a899e88fa02dd17df5601e9b2fd0cef4.zip tcl-c9396a84a899e88fa02dd17df5601e9b2fd0cef4.tar.gz tcl-c9396a84a899e88fa02dd17df5601e9b2fd0cef4.tar.bz2 |
Merge 8.7
55 files changed, 730 insertions, 429 deletions
diff --git a/.travis.yml b/.travis.yml index b114a6b..7a77509 100644 --- a/.travis.yml +++ b/.travis.yml @@ -166,136 +166,136 @@ matrix: - BUILD_DIR=macosx install: [] script: *mactest -# Test with mingw-w64 (32 bit) cross-compile +# Test with mingw-w64 cross-compile # Doesn't run tests because wine is only an imperfect Windows emulation - - name: "Linux-cross-Windows-32/GCC/Shared/no test" + - name: "Linux-cross-Windows/GCC/Shared/no test" os: linux dist: xenial - compiler: i686-w64-mingw32-gcc - addons: &mingw32 + compiler: x86_64-w64-mingw32-gcc + addons: &mingw64 apt: packages: - gcc-mingw-w64-base - - binutils-mingw-w64-i686 - - gcc-mingw-w64-i686 + - binutils-mingw-w64-x86-64 + - gcc-mingw-w64-x86-64 - gcc-mingw-w64 - - gcc-multilib - wine env: - BUILD_DIR=win - - CFGOPT=--host=i686-w64-mingw32 + - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit" script: &crosstest - make all tcltest # Include a high visibility marker that tests are skipped outright - > echo "`tput setaf 3`SKIPPED TEST: CROSS COMPILING`tput sgr0`" - - name: "Linux-cross-Windows-32/GCC/Static/no test" + - name: "Linux-cross-Windows/GCC/Static/no test" os: linux dist: xenial - compiler: i686-w64-mingw32-gcc - addons: *mingw32 + compiler: x86_64-w64-mingw32-gcc + addons: *mingw64 env: - BUILD_DIR=win - - CFGOPT="--host=i686-w64-mingw32 --disable-shared" + - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --disable-shared" script: *crosstest - - name: "Linux-cross-Windows-32/GCC/Shared/no test: UTF_MAX=6" + - name: "Linux-cross-Windows/GCC/Shared/no test: UTF_MAX=6" os: linux dist: xenial - compiler: i686-w64-mingw32-gcc - addons: *mingw32 + compiler: x86_64-w64-mingw32-gcc + addons: *mingw64 env: - BUILD_DIR=win - - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_UTF_MAX=6" + - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_UTF_MAX=6" script: *crosstest - - name: "Linux-cross-Windows-32/GCC/Shared/no test: UTF_MAX=3" + - name: "Linux-cross-Windows/GCC/Shared/no test: UTF_MAX=3" os: linux dist: xenial - compiler: i686-w64-mingw32-gcc - addons: *mingw32 + compiler: x86_64-w64-mingw32-gcc + addons: *mingw64 env: - BUILD_DIR=win - - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_UTF_MAX=3" + - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_UTF_MAX=3" script: *crosstest - - name: "Linux-cross-Windows-32/GCC/Shared/no test: NO_DEPRECATED" + - name: "Linux-cross-Windows/GCC/Shared/no test: NO_DEPRECATED" os: linux dist: xenial - compiler: i686-w64-mingw32-gcc - addons: *mingw32 + compiler: x86_64-w64-mingw32-gcc + addons: *mingw64 env: - BUILD_DIR=win - - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_NO_DEPRECATED=1" + - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1" script: *crosstest - - name: "Linux-cross-Windows-32/GCC/Debug/no test" + - name: "Linux-cross-Windows/GCC/Debug/no test" os: linux dist: xenial - compiler: i686-w64-mingw32-gcc - addons: *mingw32 + compiler: x86_64-w64-mingw32-gcc + addons: *mingw64 env: - BUILD_DIR=win - - CFGOPT="--host=i686-w64-mingw32 --enable-symbols" + - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --enable-symbols" script: *crosstest -# Test with mingw-w64 (64 bit) +# Test with mingw-w64 (32 bit) cross-compile # Doesn't run tests because wine is only an imperfect Windows emulation - - name: "Linux-cross-Windows-64/GCC/Shared/no test" + - name: "Linux-cross-Windows-32/GCC/Shared/no test" os: linux dist: xenial - compiler: x86_64-w64-mingw32-gcc - addons: &mingw64 + compiler: i686-w64-mingw32-gcc + addons: &mingw32 apt: packages: - gcc-mingw-w64-base - - binutils-mingw-w64-x86-64 - - gcc-mingw-w64-x86-64 + - binutils-mingw-w64-i686 + - gcc-mingw-w64-i686 - gcc-mingw-w64 + - gcc-multilib - wine env: - BUILD_DIR=win - - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit" + - CFGOPT=--host=i686-w64-mingw32 script: *crosstest - - name: "Linux-cross-Windows-64/GCC/Static/no test" + - name: "Linux-cross-Windows-32/GCC/Static/no test" os: linux dist: xenial - compiler: x86_64-w64-mingw32-gcc - addons: *mingw64 + compiler: i686-w64-mingw32-gcc + addons: *mingw32 env: - BUILD_DIR=win - - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --disable-shared" + - CFGOPT="--host=i686-w64-mingw32 --disable-shared" script: *crosstest - - name: "Linux-cross-Windows-64/GCC/Shared/no test: UTF_MAX=6" + - name: "Linux-cross-Windows-32/GCC/Shared/no test: UTF_MAX=6" os: linux dist: xenial - compiler: x86_64-w64-mingw32-gcc - addons: *mingw64 + compiler: i686-w64-mingw32-gcc + addons: *mingw32 env: - BUILD_DIR=win - - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_UTF_MAX=6" + - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_UTF_MAX=6" script: *crosstest - - name: "Linux-cross-Windows-64/GCC/Shared/no test: UTF_MAX=3" + - name: "Linux-cross-Windows-32/GCC/Shared/no test: UTF_MAX=3" os: linux dist: xenial - compiler: x86_64-w64-mingw32-gcc - addons: *mingw64 + compiler: i686-w64-mingw32-gcc + addons: *mingw32 env: - BUILD_DIR=win - - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_UTF_MAX=3" + - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_UTF_MAX=3" script: *crosstest - - name: "Linux-cross-Windows-64/GCC/Shared/no test: NO_DEPRECATED" + - name: "Linux-cross-Windows-32/GCC/Shared/no test: NO_DEPRECATED" os: linux dist: xenial - compiler: x86_64-w64-mingw32-gcc - addons: *mingw64 + compiler: i686-w64-mingw32-gcc + addons: *mingw32 env: - BUILD_DIR=win - - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit CFLAGS=-DTCL_NO_DEPRECATED=1" + - CFGOPT="--host=i686-w64-mingw32 CFLAGS=-DTCL_NO_DEPRECATED=1" script: *crosstest - - name: "Linux-cross-Windows-64/GCC/Debug/no test" + - name: "Linux-cross-Windows-32/GCC/Debug/no test" os: linux dist: xenial - compiler: x86_64-w64-mingw32-gcc - addons: *mingw64 + compiler: i686-w64-mingw32-gcc + addons: *mingw32 env: - BUILD_DIR=win - - CFGOPT="--host=x86_64-w64-mingw32 --enable-64bit --enable-symbols" + - CFGOPT="--host=i686-w64-mingw32 --enable-symbols" script: *crosstest # Test on Windows with MSVC native - name: "Windows/MSVC/Shared" diff --git a/doc/InitSubSyst.3 b/doc/InitSubSyst.3 new file mode 100644 index 0000000..eef801f --- /dev/null +++ b/doc/InitSubSyst.3 @@ -0,0 +1,31 @@ +'\" +'\" Copyright (c) 2018 Tcl Core Team +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +.so man.macros +.TH Tcl_InitSubsystems 3 8.7 Tcl "Tcl Library Procedures" +.BS +.SH NAME +Tcl_InitSubsystems \- initialize the Tcl library. +.SH SYNOPSIS +.nf +\fB#include <tcl.h>\fR +.sp +void +\fBTcl_InitSubsystems\fR(\fIvoid\fR) +.SH DESCRIPTION +.PP +The \fBTcl_InitSubsystems\fR procedure initializes the Tcl +library. This procedure is typically invoked as the very +first thing in the application's main program. +.PP +\fBTcl_InitSubsystems\fR is very similar in use to +\fBTcl_FindExecutable\fR. It can be used when Tcl is +used as utility library, no other encodings than utf8, +iso8859-1 or unicode are used, and no interest exists in the +value of \fBinfo nameofexecutable\fR. The system encoding will not +be extracted from the environment, but falls back to iso8859-1. +.SH KEYWORDS +binary, executable file diff --git a/generic/tcl.decls b/generic/tcl.decls index 26a58dc..910c29e 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -2481,6 +2481,9 @@ export { export { void Tcl_GetMemoryInfo(Tcl_DString *dsPtr) } +export { + void Tcl_InitSubsystems(void) +} # Local Variables: # mode: tcl diff --git a/generic/tcl.h b/generic/tcl.h index 3df2c2d..ff4cd8d 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -406,7 +406,7 @@ typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; #if defined(_WIN32) # ifdef __BORLANDC__ typedef struct stati64 Tcl_StatBuf; -# elif defined(_WIN64) || defined(__MINGW_USE_VC2005_COMPAT) || defined(_USE_64BIT_TIME_T) +# elif defined(_WIN64) || defined(_USE_64BIT_TIME_T) typedef struct __stat64 Tcl_StatBuf; # elif (defined(_MSC_VER) && (_MSC_VER < 1400)) || defined(_USE_32BIT_TIME_T) typedef struct _stati64 Tcl_StatBuf; @@ -2399,6 +2399,7 @@ EXTERN void Tcl_MainEx(int argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp, const char *version, int exact); +EXTERN void Tcl_InitSubsystems(void); EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); #ifndef _WIN32 EXTERN int TclZipfs_AppHook(int *argc, char ***argv); diff --git a/generic/tclBasic.c b/generic/tclBasic.c index eed4345..30cbb5a 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -645,7 +645,7 @@ Tcl_CreateInterp(void) char mathFuncName[32]; CallFrame *framePtr; - TclInitSubsystems(); + Tcl_InitSubsystems(); /* * Panic if someone updated the CallFrame structure without also updating @@ -657,19 +657,13 @@ Tcl_CreateInterp(void) Tcl_Panic("Tcl_CallFrame must not be smaller than CallFrame"); } -#if defined(_WIN32) && !defined(_WIN64) && !defined(_USE_64BIT_TIME_T) \ - && !defined(__MINGW_USE_VC2005_COMPAT) - /* If Tcl is compiled on Win32 using -D_USE_64BIT_TIME_T or - * -D__MINGW_USE_VC2005_COMPAT, the result is a binary incompatible - * with the 'standard' build of Tcl: All extensions using Tcl_StatBuf - * or interal functions like TclpGetDate() need to be recompiled in +#if defined(_WIN32) && !defined(_WIN64) && !defined(_USE_64BIT_TIME_T) + /* If Tcl is compiled on Win32 using -D_USE_64BIT_TIME_T + * the result is a binary incompatible with the 'standard' build of + * Tcl: All extensions using Tcl_StatBuf need to be recompiled in * the same way. Therefore, this is not officially supported. * In stead, it is recommended to use Win64 or Tcl 9.0 (not released yet) */ - if (sizeof(time_t) != 4) { - /*NOTREACHED*/ - Tcl_Panic("<time.h> is not compatible with MSVC"); - } if ((offsetof(Tcl_StatBuf,st_atime) != 32) || (offsetof(Tcl_StatBuf,st_ctime) != 40)) { /*NOTREACHED*/ diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index 57f65c8..d7604fa 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -145,7 +145,7 @@ static void ValidateMemory(struct mem_header *memHeaderP, * * Initialize the locks used by the allocator. This is only appropriate * to call in a single threaded environment, such as during - * TclInitSubsystems. + * Tcl_InitSubsystems. * *---------------------------------------------------------------------- */ diff --git a/generic/tclCompile.c b/generic/tclCompile.c index daa9166..0d38e6b 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2162,10 +2162,25 @@ TclCompileScript( * has not yet generated any bytecode. */ const char *p = script; /* Where we are in our compile. */ int depth = TclGetStackDepth(envPtr); + Interp *iPtr = (Interp *) interp; if (envPtr->iPtr == NULL) { Tcl_Panic("TclCompileScript() called on uninitialized CompileEnv"); } + /* + * Check depth to avoid overflow of the C execution stack by too many + * nested calls of TclCompileScript (considering interp recursionlimit). + * Factor 5/4 (1.25) is used to avoid too mistaken limit recognition + * during "mixed" evaluation and compilation process (nested eval+compile) + * and is good enough for default recursionlimit (1000). + */ + if (iPtr->numLevels / 5 > iPtr->maxNestingDepth / 4) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "too many nested compilations (infinite loop?)", -1)); + Tcl_SetErrorCode(interp, "TCL", "LIMIT", "STACK", NULL); + TclCompileSyntaxError(interp, envPtr); + return; + } /* Each iteration compiles one command from the script. */ @@ -2244,8 +2259,16 @@ TclCompileScript( continue; } + /* + * Avoid stack exhaustion by too many nested calls of TclCompileScript + * (considering interp recursionlimit). + */ + iPtr->numLevels++; + lastCmdIdx = CompileCommandTokens(interp, parsePtr, envPtr); + iPtr->numLevels--; + /* * TIP #280: Track lines in the just compiled command. */ diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 6b7d8b2..2dab4d5 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -1517,7 +1517,7 @@ Tcl_FindExecutable( const char *argv0) /* The value of the application's argv[0] * (native). */ { - TclInitSubsystems(); + Tcl_InitSubsystems(); TclpSetInitialEncodings(); TclpFindExecutable(argv0); } @@ -3134,7 +3134,7 @@ Iso88591FromUtfProc( const char *srcStart, *srcEnd, *srcClose; const char *dstStart, *dstEnd; int result = TCL_OK, numChars; - Tcl_UniChar ch = 0; + Tcl_UniChar ch = 0; (void)clientData; (void)statePtr; @@ -3501,6 +3501,7 @@ EscapeFromUtfProc( const TableEncodingData *tableDataPtr; const char *tablePrefixBytes; const unsigned short *const *tableFromUnicode; + Tcl_UniChar ch = 0; result = TCL_OK; @@ -3541,7 +3542,6 @@ EscapeFromUtfProc( for (numChars = 0; src < srcEnd; numChars++) { unsigned len; int word; - Tcl_UniChar ch = 0; if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) { /* diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 56d5ce5..fbc2bf3 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -1004,7 +1004,7 @@ Tcl_Exit( /* *------------------------------------------------------------------------- * - * TclInitSubsystems -- + * Tcl_InitSubsystems -- * * Initialize various subsytems in Tcl. This should be called the first * time an interp is created, or before any of the subsystems are used. @@ -1027,10 +1027,10 @@ Tcl_Exit( */ void -TclInitSubsystems(void) +Tcl_InitSubsystems(void) { if (inExit != 0) { - Tcl_Panic("TclInitSubsystems called while exiting"); + Tcl_Panic("Tcl_InitSubsystems called while exiting"); } if (subsystemsInitialized == 0) { diff --git a/generic/tclInt.h b/generic/tclInt.h index 3f967c8..caa9c0b 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3074,7 +3074,6 @@ MODULE_SCOPE void TclInitLimitSupport(Tcl_Interp *interp); MODULE_SCOPE void TclInitNamespaceSubsystem(void); MODULE_SCOPE void TclInitNotifier(void); MODULE_SCOPE void TclInitObjSubsystem(void); -MODULE_SCOPE void TclInitSubsystems(void); MODULE_SCOPE int TclInterpReady(Tcl_Interp *interp); MODULE_SCOPE int TclIsSpaceProc(int byte); MODULE_SCOPE int TclIsDigitProc(int byte); diff --git a/generic/tclPanic.c b/generic/tclPanic.c index 1096ead..a3fc47d 100644 --- a/generic/tclPanic.c +++ b/generic/tclPanic.c @@ -58,7 +58,7 @@ Tcl_SetPanicProc( else #endif panicProc = proc; - TclInitSubsystems(); + Tcl_InitSubsystems(); } /* diff --git a/generic/tclProc.c b/generic/tclProc.c index d2a10dd..6d07c2a 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -810,7 +810,7 @@ TclObjGetFrame( } else { result = -1; } - } else if (TclGetWideBitsFromObj(interp, objPtr, &w) == TCL_OK) { + } else if (TclGetWideBitsFromObj(NULL, objPtr, &w) == TCL_OK) { /* * If this were an integer, we'd have succeeded already. * Docs say we have to treat this as a 'bad level' error. @@ -819,10 +819,16 @@ TclObjGetFrame( } } - if (result == 0) { - level = curLevel - 1; - } if (result != -1) { + /* if relative current level */ + if (result == 0) { + if (!curLevel) { + /* we are in top-level, so simply generate bad level */ + name = "1"; + goto badLevel; + } + level = curLevel - 1; + } if (level >= 0) { CallFrame *framePtr; for (framePtr = iPtr->varFramePtr; framePtr != NULL; @@ -834,9 +840,9 @@ TclObjGetFrame( } } } - +badLevel: if (name == NULL) { - name = TclGetString(objPtr); + name = objPtr ? TclGetString(objPtr) : "1" ; } Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad level \"%s\"", name)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "LEVEL", name, NULL); diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c index dfda199..df685eb 100644 --- a/generic/tclThreadAlloc.c +++ b/generic/tclThreadAlloc.c @@ -1064,7 +1064,7 @@ GetBlocks( * TclInitThreadAlloc -- * * Initializes the allocator cache-maintenance structures. - * It is done early and protected during the TclInitSubsystems(). + * It is done early and protected during the Tcl_InitSubsystems(). * * Results: * None. diff --git a/generic/tclUtil.c b/generic/tclUtil.c index b4f0e79..5eaea4a 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -4399,7 +4399,7 @@ TclSetProcessGlobalValue( Tcl_IncrRefCount(newValue); cacheMap = GetThreadHash(&pgvPtr->key); ClearHash(cacheMap); - hPtr = Tcl_CreateHashEntry(cacheMap, (void *)(size_t)(pgvPtr->epoch), &dummy); + hPtr = Tcl_CreateHashEntry(cacheMap, INT2PTR(pgvPtr->epoch), &dummy); Tcl_SetHashValue(hPtr, newValue); Tcl_MutexUnlock(&pgvPtr->mutex); } @@ -4459,7 +4459,7 @@ TclGetProcessGlobalValue( } } cacheMap = GetThreadHash(&pgvPtr->key); - hPtr = Tcl_FindHashEntry(cacheMap, (void *)(size_t)epoch); + hPtr = Tcl_FindHashEntry(cacheMap, INT2PTR(epoch)); if (NULL == hPtr) { int dummy; @@ -4492,7 +4492,7 @@ TclGetProcessGlobalValue( value = Tcl_NewStringObj(pgvPtr->value, pgvPtr->numBytes); hPtr = Tcl_CreateHashEntry(cacheMap, - (void *)(size_t)(pgvPtr->epoch), &dummy); + INT2PTR(pgvPtr->epoch), &dummy); Tcl_MutexUnlock(&pgvPtr->mutex); Tcl_SetHashValue(hPtr, value); Tcl_IncrRefCount(value); diff --git a/library/dde/pkgIndex.tcl b/library/dde/pkgIndex.tcl index 7aa67fa..2716e43 100644 --- a/library/dde/pkgIndex.tcl +++ b/library/dde/pkgIndex.tcl @@ -1,5 +1,5 @@ -if {([info commands ::tcl::pkgconfig] eq "") - || ([info sharedlibextension] ne ".dll")} return +if {![package vsatisfies [package provide Tcl] 8.5-]} return +if {[info sharedlibextension] != ".dll"} return if {[::tcl::pkgconfig get debug]} { package ifneeded dde 1.4.1 [list load [file join $dir tcldde14g.dll] dde] } else { diff --git a/library/init.tcl b/library/init.tcl index d5b9c03..a26d788 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -616,7 +616,9 @@ proc auto_execok name { } set path "[file dirname [info nameof]];.;" - if {[info exists env(WINDIR)]} { + if {[info exists env(SystemRoot)]} { + set windir $env(SystemRoot) + } elseif {[info exists env(WINDIR)]} { set windir $env(WINDIR) } if {[info exists windir]} { diff --git a/library/manifest.txt b/library/manifest.txt index 11a755a..307302f 100644 --- a/library/manifest.txt +++ b/library/manifest.txt @@ -10,7 +10,7 @@ apply {{dir} { 1 opt 0.4.7 {opt optparse.tcl} 0 platform 1.0.14 {platform platform.tcl} 0 platform::shell 1.1.4 {platform shell.tcl} - 1 tcltest 2.5.0 {tcltest tcltest.tcl} + 1 tcltest 2.5.1 {tcltest tcltest.tcl} } { if {$isafe && !$safe} continue package ifneeded $package $version [list source [file join $dir {*}$file]] diff --git a/library/reg/pkgIndex.tcl b/library/reg/pkgIndex.tcl index ee559b5..650aa21 100755 --- a/library/reg/pkgIndex.tcl +++ b/library/reg/pkgIndex.tcl @@ -1,5 +1,5 @@ -if {([info commands ::tcl::pkgconfig] eq "") - || ([info sharedlibextension] ne ".dll")} return +if {![package vsatisfies [package provide Tcl] 8.5-]} return +if {[info sharedlibextension] != ".dll"} return if {[::tcl::pkgconfig get debug]} { package ifneeded registry 1.3.3 \ [list load [file join $dir tclreg13g.dll] registry] diff --git a/library/tm.tcl b/library/tm.tcl index 66c56a1..1802bb9 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -311,7 +311,7 @@ proc ::tcl::tm::UnknownHandler {original name args} { proc ::tcl::tm::Defaults {} { global env tcl_platform - lassign [split [info tclversion] .] major minor + regexp {^(\d+)\.(\d+)} [package provide Tcl] - major minor set exe [file normalize [info nameofexecutable]] # Note that we're using [::list], not [list] because [list] means @@ -354,7 +354,7 @@ proc ::tcl::tm::Defaults {} { # Calls 'path add' to paths to the list of module search paths. proc ::tcl::tm::roots {paths} { - regexp {^(\d+)\.(\d+)} [package present Tcl] - major minor + regexp {^(\d+)\.(\d+)} [package provide Tcl] - major minor foreach pa $paths { set p [file join $pa tcl$major] for {set n $minor} {$n >= 0} {incr n -1} { diff --git a/library/tzdata/America/Detroit b/library/tzdata/America/Detroit index f725874..2139aa8 100644 --- a/library/tzdata/America/Detroit +++ b/library/tzdata/America/Detroit @@ -11,6 +11,11 @@ set TZData(:America/Detroit) { {-757364400 -18000 0 EST} {-684349200 -14400 1 EDT} {-671047200 -18000 0 EST} + {-80506740 -14400 0 EDT} + {-68666400 -18000 0 EST} + {-52938000 -14400 1 EDT} + {-37216800 -18000 0 EST} + {-31518000 -18000 0 EST} {94712400 -18000 0 EST} {104914800 -14400 1 EDT} {120636000 -18000 0 EST} diff --git a/library/tzdata/America/Edmonton b/library/tzdata/America/Edmonton index 1ed38be..234b3af 100644 --- a/library/tzdata/America/Edmonton +++ b/library/tzdata/America/Edmonton @@ -20,10 +20,6 @@ set TZData(:America/Edmonton) { {-765388800 -25200 0 MST} {-715791600 -21600 1 MDT} {-702489600 -25200 0 MST} - {-84380400 -21600 1 MDT} - {-68659200 -25200 0 MST} - {-21481200 -21600 1 MDT} - {-5760000 -25200 0 MST} {73472400 -21600 1 MDT} {89193600 -25200 0 MST} {104922000 -21600 1 MDT} diff --git a/library/tzdata/America/Indiana/Tell_City b/library/tzdata/America/Indiana/Tell_City index 9eebcf7..f8014bf 100644 --- a/library/tzdata/America/Indiana/Tell_City +++ b/library/tzdata/America/Indiana/Tell_City @@ -11,12 +11,6 @@ set TZData(:America/Indiana/Tell_City) { {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-757360800 -21600 0 CST} - {-747244800 -18000 1 CDT} - {-733942800 -21600 0 CST} - {-526492800 -18000 1 CDT} - {-513190800 -21600 0 CST} - {-495043200 -18000 1 CDT} - {-481741200 -21600 0 CST} {-462996000 -18000 1 CDT} {-450291600 -21600 0 CST} {-431539200 -18000 1 CDT} @@ -28,16 +22,18 @@ set TZData(:America/Indiana/Tell_City) { {-337190400 -18000 1 CDT} {-323888400 -21600 0 CST} {-305740800 -18000 1 CDT} - {-289414800 -21600 0 CST} + {-292438800 -21600 0 CST} {-273686400 -18000 1 CDT} - {-260989200 -21600 0 CST} + {-257965200 -21600 0 CST} {-242236800 -18000 1 CDT} {-226515600 -21600 0 CST} {-210787200 -18000 1 CDT} {-195066000 -21600 0 CST} {-179337600 -18000 0 EST} - {-31518000 -18000 0 EST} - {-21488400 -14400 1 EDT} + {-68662800 -21600 0 CST} + {-52934400 -18000 1 CDT} + {-37213200 -21600 0 CST} + {-21484800 -14400 0 EDT} {-5767200 -18000 0 EST} {9961200 -14400 1 EDT} {25682400 -18000 0 EST} diff --git a/library/tzdata/America/Kentucky/Louisville b/library/tzdata/America/Kentucky/Louisville index c2aa10c..7efbec9 100644 --- a/library/tzdata/America/Kentucky/Louisville +++ b/library/tzdata/America/Kentucky/Louisville @@ -17,12 +17,9 @@ set TZData(:America/Kentucky/Louisville) { {-769395600 -18000 1 CPT} {-765392400 -21600 0 CST} {-757360800 -21600 0 CST} - {-747244800 -18000 1 CDT} + {-747251940 -18000 1 CDT} {-744224400 -21600 0 CST} - {-715795200 -18000 1 CDT} - {-684349200 -18000 1 CDT} - {-652899600 -18000 1 CDT} - {-620845200 -18000 1 CDT} + {-620841600 -18000 1 CDT} {-608144400 -21600 0 CST} {-589392000 -18000 1 CDT} {-576090000 -21600 0 CST} @@ -45,7 +42,7 @@ set TZData(:America/Kentucky/Louisville) { {-305740800 -18000 1 CDT} {-289414800 -21600 0 CST} {-273686400 -18000 1 CDT} - {-266432400 -18000 0 EST} + {-266428800 -18000 0 EST} {-63140400 -18000 0 EST} {-52938000 -14400 1 EDT} {-37216800 -18000 0 EST} diff --git a/library/tzdata/America/Vancouver b/library/tzdata/America/Vancouver index aef639a..795e9e0 100644 --- a/library/tzdata/America/Vancouver +++ b/library/tzdata/America/Vancouver @@ -9,7 +9,7 @@ set TZData(:America/Vancouver) { {-769395600 -25200 1 PPT} {-765385200 -28800 0 PST} {-747237600 -25200 1 PDT} - {-732726000 -28800 0 PST} + {-733935600 -28800 0 PST} {-715788000 -25200 1 PDT} {-702486000 -28800 0 PST} {-684338400 -25200 1 PDT} diff --git a/library/tzdata/Asia/Hong_Kong b/library/tzdata/Asia/Hong_Kong index 9420142..8f5ed2c 100644 --- a/library/tzdata/Asia/Hong_Kong +++ b/library/tzdata/Asia/Hong_Kong @@ -4,7 +4,7 @@ set TZData(:Asia/Hong_Kong) { {-9223372036854775808 27402 0 LMT} {-2056690800 28800 0 HKT} {-900910800 32400 1 HKST} - {-891579600 30600 0 HKT} + {-891579600 30600 1 HKWT} {-884248200 32400 0 JST} {-761209200 28800 0 HKT} {-747907200 32400 1 HKST} diff --git a/library/tzdata/Asia/Seoul b/library/tzdata/Asia/Seoul index b226eb5..2df8adc 100644 --- a/library/tzdata/Asia/Seoul +++ b/library/tzdata/Asia/Seoul @@ -5,6 +5,14 @@ set TZData(:Asia/Seoul) { {-1948782472 30600 0 KST} {-1830414600 32400 0 JST} {-767350800 32400 0 KST} + {-681210000 36000 1 KDT} + {-672228000 32400 0 KST} + {-654771600 36000 1 KDT} + {-640864800 32400 0 KST} + {-623408400 36000 1 KDT} + {-609415200 32400 0 KST} + {-588848400 36000 1 KDT} + {-577965600 32400 0 KST} {-498128400 30600 0 KST} {-462702600 34200 1 KDT} {-451733400 30600 0 KST} diff --git a/library/tzdata/Europe/Brussels b/library/tzdata/Europe/Brussels index 3cb9b14..907fff8 100644 --- a/library/tzdata/Europe/Brussels +++ b/library/tzdata/Europe/Brussels @@ -3,7 +3,7 @@ set TZData(:Europe/Brussels) { {-9223372036854775808 1050 0 LMT} {-2840141850 1050 0 BMT} - {-2450953050 0 0 WET} + {-2450995200 0 0 WET} {-1740355200 3600 0 CET} {-1693702800 7200 0 CEST} {-1680483600 3600 0 CET} diff --git a/library/tzdata/Europe/Istanbul b/library/tzdata/Europe/Istanbul index d00533f..a4b9b89 100644 --- a/library/tzdata/Europe/Istanbul +++ b/library/tzdata/Europe/Istanbul @@ -16,13 +16,11 @@ set TZData(:Europe/Istanbul) { {-1428030000 7200 0 EET} {-1409709600 10800 1 EEST} {-1396494000 7200 0 EET} - {-931140000 10800 1 EEST} - {-922762800 7200 0 EET} + {-931053600 10800 1 EEST} + {-922676400 7200 0 EET} {-917834400 10800 1 EEST} {-892436400 7200 0 EET} {-875844000 10800 1 EEST} - {-857358000 7200 0 EET} - {-781063200 10800 1 EEST} {-764737200 7200 0 EET} {-744343200 10800 1 EEST} {-733806000 7200 0 EET} @@ -32,45 +30,32 @@ set TZData(:Europe/Istanbul) { {-670474800 7200 0 EET} {-654141600 10800 1 EEST} {-639025200 7200 0 EET} - {-621828000 10800 1 EEST} + {-622087200 10800 1 EEST} {-606970800 7200 0 EET} {-590032800 10800 1 EEST} - {-575434800 7200 0 EET} + {-575521200 7200 0 EET} {-235620000 10800 1 EEST} - {-228279600 7200 0 EET} + {-194842800 7200 0 EET} {-177732000 10800 1 EEST} {-165726000 7200 0 EET} - {10533600 10800 1 EEST} - {23835600 7200 0 EET} - {41983200 10800 1 EEST} - {55285200 7200 0 EET} - {74037600 10800 1 EEST} - {87339600 7200 0 EET} {107910000 10800 1 EEST} - {121219200 7200 0 EET} + {121215600 7200 0 EET} {133920000 10800 1 EEST} - {152676000 7200 0 EET} - {165362400 10800 1 EEST} - {183502800 7200 0 EET} - {202428000 10800 1 EEST} - {215557200 7200 0 EET} - {228866400 10800 1 EEST} - {245797200 7200 0 EET} - {260316000 10800 1 EEST} - {277246800 14400 0 +04} - {291769200 14400 1 +04} - {308779200 10800 0 +03} - {323827200 14400 1 +04} - {340228800 10800 0 +03} - {354672000 14400 1 +04} - {371678400 10800 0 +03} - {386121600 14400 1 +04} - {403128000 10800 0 +03} - {428446800 14400 1 +04} - {433886400 10800 0 +03} - {482792400 7200 0 EET} - {482796000 10800 1 EEST} - {496702800 7200 0 EET} + {152665200 7200 0 EET} + {164678400 10800 1 EEST} + {184114800 7200 0 EET} + {196214400 10800 1 EEST} + {215564400 7200 0 EET} + {228873600 10800 1 EEST} + {245804400 7200 0 EET} + {260323200 10800 1 EEST} + {267919200 10800 0 +03} + {277254000 10800 0 +03} + {428454000 14400 1 +04} + {433893600 10800 0 +03} + {468111600 7200 0 EET} + {482799600 10800 1 EEST} + {496710000 7200 0 EET} {512521200 10800 1 EEST} {528246000 7200 0 EET} {543970800 10800 1 EEST} diff --git a/library/tzdata/Europe/Kaliningrad b/library/tzdata/Europe/Kaliningrad index e1713ae..2ce7f35 100644 --- a/library/tzdata/Europe/Kaliningrad +++ b/library/tzdata/Europe/Kaliningrad @@ -15,10 +15,11 @@ set TZData(:Europe/Kaliningrad) { {-828226800 3600 0 CET} {-812502000 7200 1 CEST} {-796777200 3600 0 CET} - {-788922000 7200 0 CET} - {-778730400 10800 1 CEST} - {-762663600 7200 0 CET} - {-757389600 10800 0 MSD} + {-781052400 7200 1 CEST} + {-780368400 7200 0 EET} + {-778730400 10800 1 EEST} + {-762663600 7200 0 EET} + {-749095200 10800 0 MSD} {354920400 14400 1 MSD} {370728000 10800 0 MSK} {386456400 14400 1 MSD} diff --git a/library/tzdata/Europe/Vienna b/library/tzdata/Europe/Vienna index 95283eb..3fdad03 100644 --- a/library/tzdata/Europe/Vienna +++ b/library/tzdata/Europe/Vienna @@ -22,7 +22,7 @@ set TZData(:Europe/Vienna) { {-780188400 3600 0 CET} {-757386000 3600 0 CET} {-748479600 7200 1 CEST} - {-733359600 3600 0 CET} + {-733273200 3600 0 CET} {-717634800 7200 1 CEST} {-701910000 3600 0 CET} {-684975600 7200 1 CEST} diff --git a/library/tzdata/Pacific/Fiji b/library/tzdata/Pacific/Fiji index b05985c..e316b93 100644 --- a/library/tzdata/Pacific/Fiji +++ b/library/tzdata/Pacific/Fiji @@ -27,165 +27,165 @@ set TZData(:Pacific/Fiji) { {1515852000 43200 0 +12} {1541253600 46800 1 +12} {1547301600 43200 0 +12} - {1572703200 46800 1 +12} - {1579356000 43200 0 +12} - {1604152800 46800 1 +12} + {1573308000 46800 1 +12} + {1578751200 43200 0 +12} + {1604757600 46800 1 +12} {1610805600 43200 0 +12} - {1636207200 46800 1 +12} + {1636812000 46800 1 +12} {1642255200 43200 0 +12} - {1667656800 46800 1 +12} + {1668261600 46800 1 +12} {1673704800 43200 0 +12} - {1699106400 46800 1 +12} + {1699711200 46800 1 +12} {1705154400 43200 0 +12} - {1730556000 46800 1 +12} - {1737208800 43200 0 +12} - {1762005600 46800 1 +12} + {1731160800 46800 1 +12} + {1736604000 43200 0 +12} + {1762610400 46800 1 +12} {1768658400 43200 0 +12} - {1793455200 46800 1 +12} + {1794060000 46800 1 +12} {1800108000 43200 0 +12} - {1825509600 46800 1 +12} + {1826114400 46800 1 +12} {1831557600 43200 0 +12} - {1856959200 46800 1 +12} + {1857564000 46800 1 +12} {1863007200 43200 0 +12} - {1888408800 46800 1 +12} + {1889013600 46800 1 +12} {1894456800 43200 0 +12} - {1919858400 46800 1 +12} - {1926511200 43200 0 +12} - {1951308000 46800 1 +12} + {1920463200 46800 1 +12} + {1925906400 43200 0 +12} + {1951912800 46800 1 +12} {1957960800 43200 0 +12} - {1983362400 46800 1 +12} + {1983967200 46800 1 +12} {1989410400 43200 0 +12} - {2014812000 46800 1 +12} + {2015416800 46800 1 +12} {2020860000 43200 0 +12} - {2046261600 46800 1 +12} + {2046866400 46800 1 +12} {2052309600 43200 0 +12} - {2077711200 46800 1 +12} + {2078316000 46800 1 +12} {2083759200 43200 0 +12} - {2109160800 46800 1 +12} + {2109765600 46800 1 +12} {2115813600 43200 0 +12} - {2140610400 46800 1 +12} + {2141215200 46800 1 +12} {2147263200 43200 0 +12} - {2172664800 46800 1 +12} + {2173269600 46800 1 +12} {2178712800 43200 0 +12} - {2204114400 46800 1 +12} + {2204719200 46800 1 +12} {2210162400 43200 0 +12} - {2235564000 46800 1 +12} + {2236168800 46800 1 +12} {2241612000 43200 0 +12} - {2267013600 46800 1 +12} - {2273666400 43200 0 +12} - {2298463200 46800 1 +12} + {2267618400 46800 1 +12} + {2273061600 43200 0 +12} + {2299068000 46800 1 +12} {2305116000 43200 0 +12} - {2329912800 46800 1 +12} + {2330517600 46800 1 +12} {2336565600 43200 0 +12} - {2361967200 46800 1 +12} + {2362572000 46800 1 +12} {2368015200 43200 0 +12} - {2393416800 46800 1 +12} + {2394021600 46800 1 +12} {2399464800 43200 0 +12} - {2424866400 46800 1 +12} + {2425471200 46800 1 +12} {2430914400 43200 0 +12} - {2456316000 46800 1 +12} - {2462968800 43200 0 +12} - {2487765600 46800 1 +12} + {2456920800 46800 1 +12} + {2462364000 43200 0 +12} + {2488370400 46800 1 +12} {2494418400 43200 0 +12} - {2519820000 46800 1 +12} + {2520424800 46800 1 +12} {2525868000 43200 0 +12} - {2551269600 46800 1 +12} + {2551874400 46800 1 +12} {2557317600 43200 0 +12} - {2582719200 46800 1 +12} + {2583324000 46800 1 +12} {2588767200 43200 0 +12} - {2614168800 46800 1 +12} - {2620821600 43200 0 +12} - {2645618400 46800 1 +12} + {2614773600 46800 1 +12} + {2620216800 43200 0 +12} + {2646223200 46800 1 +12} {2652271200 43200 0 +12} - {2677068000 46800 1 +12} + {2677672800 46800 1 +12} {2683720800 43200 0 +12} - {2709122400 46800 1 +12} + {2709727200 46800 1 +12} {2715170400 43200 0 +12} - {2740572000 46800 1 +12} + {2741176800 46800 1 +12} {2746620000 43200 0 +12} - {2772021600 46800 1 +12} + {2772626400 46800 1 +12} {2778069600 43200 0 +12} - {2803471200 46800 1 +12} - {2810124000 43200 0 +12} - {2834920800 46800 1 +12} + {2804076000 46800 1 +12} + {2809519200 43200 0 +12} + {2835525600 46800 1 +12} {2841573600 43200 0 +12} - {2866975200 46800 1 +12} + {2867580000 46800 1 +12} {2873023200 43200 0 +12} - {2898424800 46800 1 +12} + {2899029600 46800 1 +12} {2904472800 43200 0 +12} - {2929874400 46800 1 +12} + {2930479200 46800 1 +12} {2935922400 43200 0 +12} - {2961324000 46800 1 +12} + {2961928800 46800 1 +12} {2967372000 43200 0 +12} - {2992773600 46800 1 +12} + {2993378400 46800 1 +12} {2999426400 43200 0 +12} - {3024223200 46800 1 +12} + {3024828000 46800 1 +12} {3030876000 43200 0 +12} - {3056277600 46800 1 +12} + {3056882400 46800 1 +12} {3062325600 43200 0 +12} - {3087727200 46800 1 +12} + {3088332000 46800 1 +12} {3093775200 43200 0 +12} - {3119176800 46800 1 +12} + {3119781600 46800 1 +12} {3125224800 43200 0 +12} - {3150626400 46800 1 +12} - {3157279200 43200 0 +12} - {3182076000 46800 1 +12} + {3151231200 46800 1 +12} + {3156674400 43200 0 +12} + {3182680800 46800 1 +12} {3188728800 43200 0 +12} - {3213525600 46800 1 +12} + {3214130400 46800 1 +12} {3220178400 43200 0 +12} - {3245580000 46800 1 +12} + {3246184800 46800 1 +12} {3251628000 43200 0 +12} - {3277029600 46800 1 +12} + {3277634400 46800 1 +12} {3283077600 43200 0 +12} - {3308479200 46800 1 +12} + {3309084000 46800 1 +12} {3314527200 43200 0 +12} - {3339928800 46800 1 +12} - {3346581600 43200 0 +12} - {3371378400 46800 1 +12} + {3340533600 46800 1 +12} + {3345976800 43200 0 +12} + {3371983200 46800 1 +12} {3378031200 43200 0 +12} - {3403432800 46800 1 +12} + {3404037600 46800 1 +12} {3409480800 43200 0 +12} - {3434882400 46800 1 +12} + {3435487200 46800 1 +12} {3440930400 43200 0 +12} - {3466332000 46800 1 +12} + {3466936800 46800 1 +12} {3472380000 43200 0 +12} - {3497781600 46800 1 +12} - {3504434400 43200 0 +12} - {3529231200 46800 1 +12} + {3498386400 46800 1 +12} + {3503829600 43200 0 +12} + {3529836000 46800 1 +12} {3535884000 43200 0 +12} - {3560680800 46800 1 +12} + {3561285600 46800 1 +12} {3567333600 43200 0 +12} - {3592735200 46800 1 +12} + {3593340000 46800 1 +12} {3598783200 43200 0 +12} - {3624184800 46800 1 +12} + {3624789600 46800 1 +12} {3630232800 43200 0 +12} - {3655634400 46800 1 +12} + {3656239200 46800 1 +12} {3661682400 43200 0 +12} - {3687084000 46800 1 +12} - {3693736800 43200 0 +12} - {3718533600 46800 1 +12} + {3687688800 46800 1 +12} + {3693132000 43200 0 +12} + {3719138400 46800 1 +12} {3725186400 43200 0 +12} - {3750588000 46800 1 +12} + {3751192800 46800 1 +12} {3756636000 43200 0 +12} - {3782037600 46800 1 +12} + {3782642400 46800 1 +12} {3788085600 43200 0 +12} - {3813487200 46800 1 +12} + {3814092000 46800 1 +12} {3819535200 43200 0 +12} - {3844936800 46800 1 +12} + {3845541600 46800 1 +12} {3850984800 43200 0 +12} - {3876386400 46800 1 +12} + {3876991200 46800 1 +12} {3883039200 43200 0 +12} - {3907836000 46800 1 +12} + {3908440800 46800 1 +12} {3914488800 43200 0 +12} - {3939890400 46800 1 +12} + {3940495200 46800 1 +12} {3945938400 43200 0 +12} - {3971340000 46800 1 +12} + {3971944800 46800 1 +12} {3977388000 43200 0 +12} - {4002789600 46800 1 +12} + {4003394400 46800 1 +12} {4008837600 43200 0 +12} - {4034239200 46800 1 +12} - {4040892000 43200 0 +12} - {4065688800 46800 1 +12} + {4034844000 46800 1 +12} + {4040287200 43200 0 +12} + {4066293600 46800 1 +12} {4072341600 43200 0 +12} - {4097138400 46800 1 +12} + {4097743200 46800 1 +12} } diff --git a/library/tzdata/Pacific/Norfolk b/library/tzdata/Pacific/Norfolk index f0556ab..f686df5 100644 --- a/library/tzdata/Pacific/Norfolk +++ b/library/tzdata/Pacific/Norfolk @@ -5,6 +5,168 @@ set TZData(:Pacific/Norfolk) { {-2177493112 40320 0 +1112} {-599656320 41400 0 +1130} {152029800 45000 1 +1230} - {162912600 41400 0 +1130} + {162916200 41400 0 +1130} {1443882600 39600 0 +11} + {1561899600 39600 0 +12} + {1570287600 43200 1 +12} + {1586012400 39600 0 +12} + {1601737200 43200 1 +12} + {1617462000 39600 0 +12} + {1633186800 43200 1 +12} + {1648911600 39600 0 +12} + {1664636400 43200 1 +12} + {1680361200 39600 0 +12} + {1696086000 43200 1 +12} + {1712415600 39600 0 +12} + {1728140400 43200 1 +12} + {1743865200 39600 0 +12} + {1759590000 43200 1 +12} + {1775314800 39600 0 +12} + {1791039600 43200 1 +12} + {1806764400 39600 0 +12} + {1822489200 43200 1 +12} + {1838214000 39600 0 +12} + {1853938800 43200 1 +12} + {1869663600 39600 0 +12} + {1885993200 43200 1 +12} + {1901718000 39600 0 +12} + {1917442800 43200 1 +12} + {1933167600 39600 0 +12} + {1948892400 43200 1 +12} + {1964617200 39600 0 +12} + {1980342000 43200 1 +12} + {1996066800 39600 0 +12} + {2011791600 43200 1 +12} + {2027516400 39600 0 +12} + {2043241200 43200 1 +12} + {2058966000 39600 0 +12} + {2075295600 43200 1 +12} + {2091020400 39600 0 +12} + {2106745200 43200 1 +12} + {2122470000 39600 0 +12} + {2138194800 43200 1 +12} + {2153919600 39600 0 +12} + {2169644400 43200 1 +12} + {2185369200 39600 0 +12} + {2201094000 43200 1 +12} + {2216818800 39600 0 +12} + {2233148400 43200 1 +12} + {2248873200 39600 0 +12} + {2264598000 43200 1 +12} + {2280322800 39600 0 +12} + {2296047600 43200 1 +12} + {2311772400 39600 0 +12} + {2327497200 43200 1 +12} + {2343222000 39600 0 +12} + {2358946800 43200 1 +12} + {2374671600 39600 0 +12} + {2390396400 43200 1 +12} + {2406121200 39600 0 +12} + {2422450800 43200 1 +12} + {2438175600 39600 0 +12} + {2453900400 43200 1 +12} + {2469625200 39600 0 +12} + {2485350000 43200 1 +12} + {2501074800 39600 0 +12} + {2516799600 43200 1 +12} + {2532524400 39600 0 +12} + {2548249200 43200 1 +12} + {2563974000 39600 0 +12} + {2579698800 43200 1 +12} + {2596028400 39600 0 +12} + {2611753200 43200 1 +12} + {2627478000 39600 0 +12} + {2643202800 43200 1 +12} + {2658927600 39600 0 +12} + {2674652400 43200 1 +12} + {2690377200 39600 0 +12} + {2706102000 43200 1 +12} + {2721826800 39600 0 +12} + {2737551600 43200 1 +12} + {2753276400 39600 0 +12} + {2769606000 43200 1 +12} + {2785330800 39600 0 +12} + {2801055600 43200 1 +12} + {2816780400 39600 0 +12} + {2832505200 43200 1 +12} + {2848230000 39600 0 +12} + {2863954800 43200 1 +12} + {2879679600 39600 0 +12} + {2895404400 43200 1 +12} + {2911129200 39600 0 +12} + {2926854000 43200 1 +12} + {2942578800 39600 0 +12} + {2958908400 43200 1 +12} + {2974633200 39600 0 +12} + {2990358000 43200 1 +12} + {3006082800 39600 0 +12} + {3021807600 43200 1 +12} + {3037532400 39600 0 +12} + {3053257200 43200 1 +12} + {3068982000 39600 0 +12} + {3084706800 43200 1 +12} + {3100431600 39600 0 +12} + {3116761200 43200 1 +12} + {3132486000 39600 0 +12} + {3148210800 43200 1 +12} + {3163935600 39600 0 +12} + {3179660400 43200 1 +12} + {3195385200 39600 0 +12} + {3211110000 43200 1 +12} + {3226834800 39600 0 +12} + {3242559600 43200 1 +12} + {3258284400 39600 0 +12} + {3274009200 43200 1 +12} + {3289734000 39600 0 +12} + {3306063600 43200 1 +12} + {3321788400 39600 0 +12} + {3337513200 43200 1 +12} + {3353238000 39600 0 +12} + {3368962800 43200 1 +12} + {3384687600 39600 0 +12} + {3400412400 43200 1 +12} + {3416137200 39600 0 +12} + {3431862000 43200 1 +12} + {3447586800 39600 0 +12} + {3463311600 43200 1 +12} + {3479641200 39600 0 +12} + {3495366000 43200 1 +12} + {3511090800 39600 0 +12} + {3526815600 43200 1 +12} + {3542540400 39600 0 +12} + {3558265200 43200 1 +12} + {3573990000 39600 0 +12} + {3589714800 43200 1 +12} + {3605439600 39600 0 +12} + {3621164400 43200 1 +12} + {3636889200 39600 0 +12} + {3653218800 43200 1 +12} + {3668943600 39600 0 +12} + {3684668400 43200 1 +12} + {3700393200 39600 0 +12} + {3716118000 43200 1 +12} + {3731842800 39600 0 +12} + {3747567600 43200 1 +12} + {3763292400 39600 0 +12} + {3779017200 43200 1 +12} + {3794742000 39600 0 +12} + {3810466800 43200 1 +12} + {3826191600 39600 0 +12} + {3842521200 43200 1 +12} + {3858246000 39600 0 +12} + {3873970800 43200 1 +12} + {3889695600 39600 0 +12} + {3905420400 43200 1 +12} + {3921145200 39600 0 +12} + {3936870000 43200 1 +12} + {3952594800 39600 0 +12} + {3968319600 43200 1 +12} + {3984044400 39600 0 +12} + {4000374000 43200 1 +12} + {4016098800 39600 0 +12} + {4031823600 43200 1 +12} + {4047548400 39600 0 +12} + {4063273200 43200 1 +12} + {4078998000 39600 0 +12} + {4094722800 43200 1 +12} } diff --git a/tests/chanio.test b/tests/chanio.test index 4b71fef..c7c07ce 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -1881,7 +1881,7 @@ test chan-io-20.3 {Tcl_CreateChannel: initial settings} -constraints {unix} -bod } -result {{{} {}} {auto lf}} test chan-io-20.5 {Tcl_CreateChannel: install channel in empty slot} -setup { set path(stdout) [makeFile {} stdout] -} -constraints {stdio openpipe} -body { +} -constraints {stdio openpipe knownMsvcBug} -body { set f [open $path(script) w] chan puts -nonewline $f { chan close stdout @@ -2025,7 +2025,7 @@ test chan-io-27.4 {FlushChannel, implicit flush when buffer fills} -setup { test chan-io-27.5 {FlushChannel, implicit flush when buffer fills and on chan close} -setup { file delete $path(test1) set l "" -} -constraints {unixOrPc} -body { +} -constraints {unixOrWin} -body { set f [open $path(test1) w] chan configure $f -translation lf -buffersize 60 -eofchar {} lappend l [file size $path(test1)] @@ -2817,7 +2817,7 @@ test chan-io-29.34 {Tcl_Chan Close, async flush on chan close, using sockets} -s chan close $cs chan close $ss vwait [namespace which -variable x] - return $c + set c } -result 2000 test chan-io-29.35 {Tcl_Chan Close vs chan event vs multiple interpreters} -setup { catch {interp delete x} @@ -7033,7 +7033,7 @@ test chan-io-53.8 {CopyData: async callback and error handling, Bug 1932639} -se vwait ::forever catch {after cancel $token} # Report - return $::RES + set ::RES } -cleanup { chan close $f chan close $g @@ -7233,7 +7233,7 @@ test chan-io-54.1 {Recursive channel events} {socket fileevent} { for {set i 0} {$i < 10} {incr i} { if {![catch { set cs [socket 127.0.0.1 [lindex [chan configure $ss -sockname] 2]] - }]} then { + }]} { set done 1 break } @@ -7305,7 +7305,7 @@ test chan-io-54.2 {Testing for busy-wait in recursive channel events} -setup { chan close $writer chan close $s after cancel $after - return $counter + set counter } -cleanup { if {$accept ne {}} {chan close $accept} } -result 1 @@ -7332,7 +7332,7 @@ test chan-io-55.1 {ChannelEventScriptInvoker: deletion} -constraints { chan event $f writable [namespace code [list eventScript $f]] variable x not_done vwait [namespace which -variable x] - return $x + set x } -cleanup { interp bgerror {} $handler } -result {got_error} @@ -7377,7 +7377,7 @@ test chan-io-57.1 {buffered data and file events, gets} -setup { vwait [namespace which -variable result] lappend result [chan gets $s2] vwait [namespace which -variable result] - return $result + set result } -cleanup { chan close $s chan close $s2 @@ -7402,14 +7402,14 @@ test chan-io-57.2 {buffered data and file events, read} -setup { vwait [namespace which -variable result] lappend result [chan read $s2 9] vwait [namespace which -variable result] - return $result + set result } -cleanup { chan close $s chan close $s2 chan close $server } -result {1 readable 234567890 timer} -test chan-io-58.1 {Tcl_NotifyChannel and error when closing} {stdio unixOrPc openpipe fileevent} { +test chan-io-58.1 {Tcl_NotifyChannel and error when closing} {stdio unixOrWin openpipe fileevent} { set out [open $path(script) w] chan puts $out { chan puts "normal message from pipe" diff --git a/tests/cmdAH.test b/tests/cmdAH.test index b15c77d..992a8f4 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -23,14 +23,13 @@ testConstraint testsetplatform [llength [info commands testsetplatform]] testConstraint testvolumetype [llength [info commands testvolumetype]] testConstraint time64bit [expr { $::tcl_platform(pointerSize) >= 8 || - [llength [info command testsize]] && [testsize time_t] >= 8 + [llength [info command testsize]] && [testsize st_mtime] >= 8 }] testConstraint linkDirectory [expr { ![testConstraint win] || ($::tcl_platform(osVersion) >= 5.0 && [lindex [file system [temporaryDirectory]] 1] eq "NTFS") }] -testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}] global env set cmdAHwd [pwd] @@ -893,7 +892,7 @@ test cmdAH-18.3 {Tcl_FileObjCmd: executable} {unix testchmod} { file exe $gorpfile } 1 test cmdAH-18.5 {Tcl_FileObjCmd: executable} -constraints {win} -body { - # On pc, must be a .exe, .com, etc. + # On windows, must be a .exe, .com, etc. set x {} set gorpexes {} foreach ext {exe com cmd bat} { @@ -1315,8 +1314,28 @@ test cmdAH-24.20.2 {Tcl_FileObjCmd: mtime 64-bit time_t, bug [4718b41c56]} -cons test cmdAH-25.1 {Tcl_FileObjCmd: owned} -returnCodes error -body { file owned a b } -result {wrong # args: should be "file owned name"} -test cmdAH-25.2 {Tcl_FileObjCmd: owned} -constraints win -body { - file owned $gorpfile +test cmdAH-25.2 {Tcl_FileObjCmd: owned} -constraints win -setup { + set fn $gorpfile + # prefer temp file to check owner (try to avoid bug [7de2d722bd]): + if { + [info exists ::env(TEMP)] && [file isdirectory $::env(TEMP)] && + [file dirname $fn] ne [file normalize $::env(TEMP)] + } { + set fn [file join $::env(TEMP)/test-owner-from-tcl.txt] + set fn [makeFile "data" test-owner-from-tcl.txt $::env(TEMP)] + } + # be sure we have really owned this file before trying to check that + # (avoid dependency on admin with UAC and the setting "System objects: + # Default owner for objects created by members of the Administrators group"): + catch { + exec takeown /F [file nativename $fn] + } +} -body { + file owned $fn +} -cleanup { + if {$fn ne $gorpfile} { + removeFile $fn + } } -result 1 test cmdAH-25.2.1 {Tcl_FileObjCmd: owned} -constraints unix -setup { # Avoid problems with AFS @@ -1329,8 +1348,12 @@ test cmdAH-25.2.1 {Tcl_FileObjCmd: owned} -constraints unix -setup { test cmdAH-25.3 {Tcl_FileObjCmd: owned} {unix notRoot} { file owned / } 0 -test cmdAH-25.3.1 {Tcl_FileObjCmd: owned} -constraints {win knownMsvcBug} -body { - file owned $env(windir) +test cmdAH-25.3.1 {Tcl_FileObjCmd: owned} -constraints win -body { + if {[info exists env(SystemRoot)]} { + file owned $env(SystemRoot) + } else { + file owned $env(windir) + } } -result 0 test cmdAH-25.4 {Tcl_FileObjCmd: owned} -body { file owned nosuchfile diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test index 721890c..1790f1d 100644 --- a/tests/cmdMZ.test +++ b/tests/cmdMZ.test @@ -230,12 +230,12 @@ foreach {testid script} { # More tests of Tcl_SourceObjCmd are in source.test test cmdMZ-3.3 {Tcl_SourceObjCmd: error conditions} -constraints { - unixOrPc + unixOrWin } -returnCodes error -body { source } -match glob -result {wrong # args: should be "source*fileName"} test cmdMZ-3.4 {Tcl_SourceObjCmd: error conditions} -constraints { - unixOrPc + unixOrWin } -returnCodes error -body { source a b c d e f } -match glob -result {wrong # args: should be "source*fileName"} diff --git a/tests/compile.test b/tests/compile.test index 2aa5ef6..4d57549 100644 --- a/tests/compile.test +++ b/tests/compile.test @@ -468,10 +468,13 @@ test compile-13.1 {testing underestimate of maxStackSize in list cmd} {exec} { # Tests of nested compile (body in body compilation), should not generate stack overflow # (with abnormal program termination), bug [fec0c17d39]: -test compile-13.2 {TclCompileScript: testing nested scripts compilation} -setup { - set i [interp create] - interp recursionlimit $i [expr {10000+50}] - $i eval {proc gencode {nr {cmd eval} {nl 0}} { +proc _ti_gencode {} { + # creates test interpreter on demand with [gencode] generator: + if {[interp exists ti]} { + return + } + interp create ti + ti eval {proc gencode {nr {cmd eval} {nl 0}} { set code "" set e ""; if {$nl} {set e "\n"} for {set i 0} {$i < $nr} {incr i} { @@ -484,18 +487,45 @@ test compile-13.2 {TclCompileScript: testing nested scripts compilation} -setup #puts [format "%% %.40s ... %d bytes" $code [string length $code]] return $code }} +} +test compile-13.2 {TclCompileScript: testing expected nested scripts compilation} -setup { + _ti_gencode + interp recursionlimit ti [expr {10000+50}] + ti eval {set result {}} } -body { # Test different compilation variants (instructions evalStk, invokeStk, etc), # with 2000 (1000 in debug) nested scripts (bodies). If you get SO/SF exceptions on some low-stack # boxes or systems, please don't decrease it (either provide a constraint) - $i eval {foreach cmd {eval "if 1" try catch} { + ti eval {foreach cmd {eval "if 1" try catch} { set c [gencode [expr {![::tcl::pkgconfig get debug] ? 2000 : 1000}] $cmd] if 1 $c }} - $i eval {set result} -} -result {1 1 1 1} -cleanup { - interp delete $i + ti eval {set result} +} -result {1 1 1 1} +test compile-13.3 {TclCompileScript: testing check of max depth by nested scripts compilation} -setup { + _ti_gencode + interp recursionlimit ti 100 + ti eval {set result {}} +} -body { + # Test different compilation variants (instructions evalStk, invokeStk, etc), + # with 500 nested scripts (bodies). It must generate "too many nested compilations" + # error for any variant we're testing here: + ti eval {foreach cmd {eval "if 1" try catch} { + set c [gencode [expr {![info exists ::tcl_platform(debug)] ? 2000 : 1000}] $cmd] + lappend errors [catch $c e] $e + }} + #puts $errors + # all of nested calls exceed the limit, so must end with "too many nested compilations" + # (or evaluations, depending on compile method/instruction and "mixed" compile within + # evaliation), so no one succeeds, the result must be empty: + ti eval {set result} +} -result {} +# +# clean up: +if {[interp exists ti]} { + interp delete ti } +rename _ti_gencode {} # Tests compile-14.* for [Bug 599788] [Bug 0c043a175a47da8c2342] test compile-14.1 {testing errors in element name; segfault?} {} { diff --git a/tests/fCmd.test b/tests/fCmd.test index a6e90a1..e8ed6f9 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -276,7 +276,7 @@ test fCmd-3.14 {FileCopyRename: FileBasename fails} -setup { } -result {user "_totally_bogus_user" doesn't exist} test fCmd-3.15 {FileCopyRename: source[0] == '\0'} -setup { cleanup -} -constraints {notRoot unixOrPc} -returnCodes error -body { +} -constraints {notRoot unixOrWin} -returnCodes error -body { file mkdir td1 file rename / td1 } -result {error renaming "/" to "td1": file already exists} @@ -416,7 +416,7 @@ test fCmd-5.4 {TclFileDeleteCmd: multiple files} -constraints notRoot -setup { } -cleanup {cleanup} -result {1 1 1 0 0 0} test fCmd-5.5 {TclFileDeleteCmd: stop at first error} -setup { cleanup -} -constraints {notRoot unixOrPc} -body { +} -constraints {notRoot unixOrWin} -body { createfile tf1 createfile tf2 file mkdir td1 @@ -1116,7 +1116,7 @@ test fCmd-10.5 {file copy: comprehensive: dir to empty dir} -setup { } -result [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4 tds1 tds2 tds3 tds4} {1 {error copying "td1" to "[file join td2 td1]": file already exists}} {1 {error copying "tds1" to "[file join tdd1 tds1]": file already exists}} 1 1 1}] test fCmd-10.6 {file copy: comprehensive: dir to non-empty dir} -setup { cleanup -} -constraints {notRoot unixOrPc testchmod} -body { +} -constraints {notRoot unixOrWin testchmod} -body { file mkdir tds1 file mkdir tds2 file mkdir [file join tdd1 tds1 xxx] diff --git a/tests/fileName.test b/tests/fileName.test index 7b51da1..0e4cb9e 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -1089,13 +1089,13 @@ file delete -force $tildeglobname set globname globTest unset horribleglobname tildeglobname -test filename-12.1 {simple globbing} {unixOrPc} { +test filename-12.1 {simple globbing} {unixOrWin} { glob {} } {.} -test filename-12.1.1 {simple globbing} -constraints {unixOrPc} -body { +test filename-12.1.1 {simple globbing} -constraints {unixOrWin} -body { glob -types f {} } -returnCodes error -result {no files matched glob pattern ""} -test filename-12.1.2 {simple globbing} {unixOrPc} { +test filename-12.1.2 {simple globbing} {unixOrWin} { glob -types d {} } {.} test filename-12.1.3 {simple globbing} {unix} { @@ -1116,7 +1116,7 @@ test filename-12.3 {simple globbing} { set globPreResult globTest/ set x1 x1.c set y1 y1.c -test filename-12.4 {simple globbing} {unixOrPc} { +test filename-12.4 {simple globbing} {unixOrWin} { lsort [glob globTest/x1.c globTest/y1.c globTest/foo] } "$globPreResult$x1 $globPreResult$y1" test filename-12.5 {simple globbing} { @@ -1178,32 +1178,32 @@ test filename-13.9 {globbing with brace substitution} { test filename-13.10 {globbing with brace substitution} { lsort [glob globTest/\{x,,y\}1.c] } [list $globPreResult$x1 $globPreResult$y1] -test filename-13.11 {globbing with brace substitution} {unixOrPc} { +test filename-13.11 {globbing with brace substitution} {unixOrWin} { lsort [glob globTest/\{x,x\\,z,z\}1.c] } [lsort {globTest/x1.c globTest/x,z1.c globTest/z1.c}] test filename-13.13 {globbing with brace substitution} { lsort [glob globTest/{a,b,x,y}1.c] } [list $globPreResult$x1 $globPreResult$y1] -test filename-13.14 {globbing with brace substitution} {unixOrPc} { +test filename-13.14 {globbing with brace substitution} {unixOrWin} { lsort [glob {globTest/{x1,y2,weird name}.c}] } {{globTest/weird name.c} globTest/x1.c} -test filename-13.16 {globbing with brace substitution} {unixOrPc} { +test filename-13.16 {globbing with brace substitution} {unixOrWin} { lsort [glob globTest/{x1.c,a1/*}] } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} -test filename-13.18 {globbing with brace substitution} {unixOrPc} { +test filename-13.18 {globbing with brace substitution} {unixOrWin} { lsort [glob globTest/{x1.c,{a},a1/*}] } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} -test filename-13.20 {globbing with brace substitution} {unixOrPc} { +test filename-13.20 {globbing with brace substitution} {unixOrWin} { lsort [glob globTest/{a,x}1/*/{x,y}*] } {globTest/a1/b1/x2.c globTest/a1/b2/y2.c} test filename-13.22 {globbing with brace substitution} -body { glob globTest/\{a,x\}1/*/\{ } -returnCodes error -result {unmatched open-brace in file name} -test filename-14.1 {asterisks, question marks, and brackets} {unixOrPc} { +test filename-14.1 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob glo*/*.c] } {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.3 {asterisks, question marks, and brackets} {unixOrPc} { +test filename-14.3 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob globTest/?1.c] } {globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.5 {asterisks, question marks, and brackets} -setup { @@ -1213,7 +1213,7 @@ test filename-14.5 {asterisks, question marks, and brackets} -setup { file rename globTest [file join globTestContext globTest] set savepwd [pwd] cd globTestContext -} -constraints {unixOrPc} -body { +} -constraints {unixOrWin} -body { lsort [glob */*/*/*.c] } -cleanup { # Reset to where we were @@ -1227,16 +1227,16 @@ test filename-14.7 {asterisks, question marks, and brackets} {unix} { test filename-14.7.1 {asterisks, question marks, and brackets} {win} { lsort [glob globTest/*] } {globTest/.1 globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.9 {asterisks, question marks, and brackets} {unixOrPc} { +test filename-14.9 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob globTest/.*] } {globTest/. globTest/.. globTest/.1} -test filename-14.11 {asterisks, question marks, and brackets} {unixOrPc} { +test filename-14.11 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob globTest/*/*] } {globTest/a1/b1 globTest/a1/b2 globTest/a2/b3} -test filename-14.13 {asterisks, question marks, and brackets} {unixOrPc} { +test filename-14.13 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob {globTest/[xyab]1.*}] } {globTest/x1.c globTest/y1.c} -test filename-14.15 {asterisks, question marks, and brackets} {unixOrPc} { +test filename-14.15 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob globTest/*/] } {globTest/a1/ globTest/a2/ globTest/a3/} test filename-14.17 {asterisks, question marks, and brackets} -setup { @@ -1248,7 +1248,7 @@ test filename-14.17 {asterisks, question marks, and brackets} -setup { } -cleanup { set env(HOME) $temp } -result [list [file join $env(HOME) globTest z1.c]] -test filename-14.18 {asterisks, question marks, and brackets} {unixOrPc} { +test filename-14.18 {asterisks, question marks, and brackets} {unixOrWin} { lsort [glob globTest/*.c goo/*] } {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.20 {asterisks, question marks, and brackets} { @@ -1287,16 +1287,16 @@ test filename-14.25.1 {type specific globbing} {win} { test filename-14.26 {type specific globbing} { glob -nocomplain -dir globTest -types {readonly} * } {} -test filename-14.27 {Bug 2710920} {unixOrPc} { +test filename-14.27 {Bug 2710920} {unixOrWin} { file tail [lindex [lsort [glob globTest/*/]] 0] } a1 -test filename-14.28 {Bug 2710920} {unixOrPc} { +test filename-14.28 {Bug 2710920} {unixOrWin} { file dirname [lindex [lsort [glob globTest/*/]] 0] } globTest -test filename-14.29 {Bug 2710920} {unixOrPc} { +test filename-14.29 {Bug 2710920} {unixOrWin} { file extension [lindex [lsort [glob globTest/*/]] 0] } {} -test filename-14.30 {Bug 2710920} {unixOrPc} { +test filename-14.30 {Bug 2710920} {unixOrWin} { file rootname [lindex [lsort [glob globTest/*/]] 0] } globTest/a1/ diff --git a/tests/interp.test b/tests/interp.test index 76ac01f..599ac08 100644 --- a/tests/interp.test +++ b/tests/interp.test @@ -1836,7 +1836,7 @@ test interp-23.1 {testing hiding vs aliases: unsafe interp} -setup { test interp-23.2 {testing hiding vs aliases: safe interp} -setup { catch {interp delete a} set l "" -} -constraints {unixOrPc} -body { +} -constraints {unixOrWin} -body { interp create a -safe lappend l [lsort [interp hidden a]] a alias bar bar diff --git a/tests/io.test b/tests/io.test index d4f010a..9bd87ef 100644 --- a/tests/io.test +++ b/tests/io.test @@ -2212,7 +2212,7 @@ test io-27.4 {FlushChannel, implicit flush when buffer fills} { set l } {0 60 72} test io-27.5 {FlushChannel, implicit flush when buffer fills and on close} \ - {unixOrPc} { + {unixOrWin} { file delete $path(test1) set f [open $path(test1) w] fconfigure $f -translation lf -buffersize 60 -eofchar {} @@ -8293,7 +8293,7 @@ test io-57.2 {buffered data and file events, read} {fileevent} { set result } {1 readable 234567890 timer} -test io-58.1 {Tcl_NotifyChannel and error when closing} {stdio unixOrPc openpipe fileevent} { +test io-58.1 {Tcl_NotifyChannel and error when closing} {stdio unixOrWin openpipe fileevent} { set out [open $path(script) w] puts $out { puts "normal message from pipe" diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 89afb0a..7f7a182 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -295,7 +295,7 @@ removeFile fconfigure.dummy test iocmd-8.14 {fconfigure command} { fconfigure stdin -buffers } 4096 -test iocmd-8.15.1 {fconfigure command / tcp channel} -constraints {socket unixOrPc} -setup { +test iocmd-8.15.1 {fconfigure command / tcp channel} -constraints {socket unixOrWin} -setup { set srv [socket -server iocmdSRV -myaddr 127.0.0.1 0] set port [lindex [fconfigure $srv -sockname] 2] proc iocmdSRV {sock ip port} {close $sock} @@ -403,18 +403,18 @@ test iocmd-10.5 {fblocked command} { set path(test4) [makeFile {} test4] set path(test5) [makeFile {} test5] -test iocmd-11.1 {I/O to command pipelines} {unixOrPc unixExecs} { +test iocmd-11.1 {I/O to command pipelines} {unixOrWin unixExecs} { set f [open $path(test4) w] close $f list [catch {open "| cat < \"$path(test4)\" > \"$path(test5)\"" w} msg] $msg $::errorCode } {1 {can't write input to command: standard input was redirected} {TCL OPERATION EXEC BADREDIRECT}} -test iocmd-11.2 {I/O to command pipelines} {unixOrPc unixExecs} { +test iocmd-11.2 {I/O to command pipelines} {unixOrWin unixExecs} { list [catch {open "| echo > \"$path(test5)\"" r} msg] $msg $::errorCode } {1 {can't read output from command: standard output was redirected} {TCL OPERATION EXEC BADREDIRECT}} -test iocmd-11.3 {I/O to command pipelines} {unixOrPc unixExecs} { +test iocmd-11.3 {I/O to command pipelines} {unixOrWin unixExecs} { list [catch {open "| echo > \"$path(test5)\"" r+} msg] $msg $::errorCode } {1 {can't read output from command: standard output was redirected} {TCL OPERATION EXEC BADREDIRECT}} -test iocmd-11.4 {I/O to command pipelines} {notValgrind unixOrPc} { +test iocmd-11.4 {I/O to command pipelines} {notValgrind unixOrWin} { list [catch {open "| no_such_command_exists" rb} msg] $msg $::errorCode } {1 {couldn't execute "no_such_command_exists": no such file or directory} {POSIX ENOENT {no such file or directory}}} diff --git a/tests/pid.test b/tests/pid.test index d21dbaa..af21f30 100644 --- a/tests/pid.test +++ b/tests/pid.test @@ -21,7 +21,7 @@ testConstraint pidDefined [llength [info commands pid]] test pid-1.1 {pid command} pidDefined { regexp {(^[0-9]+$)|(^0x[0-9a-fA-F]+$)} [pid] } 1 -test pid-1.2 {pid command} -constraints {unixOrPc unixExecs pidDefined} -setup { +test pid-1.2 {pid command} -constraints {unixOrWin unixExecs pidDefined} -setup { set path(test1) [makeFile {} test1] file delete $path(test1) } -body { diff --git a/tests/socket.test b/tests/socket.test index 84320bd..20b890d 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -1084,7 +1084,7 @@ test socket_$af-7.4 {testing socket specific options} -constraints [list socket test socket_$af-7.5 {testing socket specific options} -setup { set timer [after 10000 "set x timed_out"] set l "" -} -constraints [list socket supported_$af unixOrPc] -body { +} -constraints [list socket supported_$af unixOrWin] -body { set s [socket -server accept 0] proc accept {s a p} { global x diff --git a/tests/tcltest.test b/tests/tcltest.test index ca720ee..c856209 100644 --- a/tests/tcltest.test +++ b/tests/tcltest.test @@ -98,44 +98,44 @@ proc slave {msgVar args} { } return $code } -test tcltest-2.0 {tcltest (verbose default - 'b')} {unixOrPc} { +test tcltest-2.0 {tcltest (verbose default - 'b')} {unixOrWin} { set result [slave msg test.tcl] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 1 0 0 1} -test tcltest-2.1 {tcltest -verbose 'b'} {unixOrPc} { +test tcltest-2.1 {tcltest -verbose 'b'} {unixOrWin} { set result [slave msg test.tcl -verbose 'b'] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 1 0 0 1} -test tcltest-2.2 {tcltest -verbose 'p'} {unixOrPc} { +test tcltest-2.2 {tcltest -verbose 'p'} {unixOrWin} { set result [slave msg test.tcl -verbose 'p'] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 0 1 0 1} -test tcltest-2.3 {tcltest -verbose 's'} {unixOrPc} { +test tcltest-2.3 {tcltest -verbose 's'} {unixOrWin} { set result [slave msg test.tcl -verbose 's'] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 0 0 1 1} -test tcltest-2.4 {tcltest -verbose 'ps'} {unixOrPc} { +test tcltest-2.4 {tcltest -verbose 'ps'} {unixOrWin} { set result [slave msg test.tcl -verbose 'ps'] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 0 1 1 1} -test tcltest-2.5 {tcltest -verbose 'psb'} {unixOrPc} { +test tcltest-2.5 {tcltest -verbose 'psb'} {unixOrWin} { set result [slave msg test.tcl -verbose 'psb'] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 1 1 1 1} -test tcltest-2.5a {tcltest -verbose 'pass skip body'} {unixOrPc} { +test tcltest-2.5a {tcltest -verbose 'pass skip body'} {unixOrWin} { set result [slave msg test.tcl -verbose "pass skip body"] list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \ [regexp c-1.0 $msg] \ @@ -143,7 +143,7 @@ test tcltest-2.5a {tcltest -verbose 'pass skip body'} {unixOrPc} { } {0 1 1 1 1} test tcltest-2.6 {tcltest -verbose 't'} { - -constraints {unixOrPc} + -constraints {unixOrWin} -body { set result [slave msg test.tcl -verbose 't'] list $result $msg @@ -153,7 +153,7 @@ test tcltest-2.6 {tcltest -verbose 't'} { } test tcltest-2.6a {tcltest -verbose 'start'} { - -constraints {unixOrPc} + -constraints {unixOrWin} -body { set result [slave msg test.tcl -verbose start] list $result $msg @@ -176,7 +176,7 @@ test tcltest-2.7 {tcltest::verbose} { } test tcltest-2.8 {tcltest -verbose 'error'} { - -constraints {unixOrPc} + -constraints {unixOrWin} -body { set result [slave msg test.tcl -verbose error] list $result $msg @@ -185,22 +185,22 @@ test tcltest-2.8 {tcltest -verbose 'error'} { -match regexp } # -match, [match] -test tcltest-3.1 {tcltest -match 'a*'} {unixOrPc} { +test tcltest-3.1 {tcltest -match 'a*'} {unixOrWin} { set result [slave msg test.tcl -match a* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg] } {0 1 0 0 1} -test tcltest-3.2 {tcltest -match 'b*'} {unixOrPc} { +test tcltest-3.2 {tcltest -match 'b*'} {unixOrWin} { set result [slave msg test.tcl -match b* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+0.+Skipped.+3.+Failed.+1" $msg] } {0 0 1 0 1} -test tcltest-3.3 {tcltest -match 'c*'} {unixOrPc} { +test tcltest-3.3 {tcltest -match 'c*'} {unixOrWin} { set result [slave msg test.tcl -match c* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+0.+Skipped.+4.+Failed.+0" $msg] } {0 0 0 1 1} -test tcltest-3.4 {tcltest -match 'a* b*'} {unixOrPc} { +test tcltest-3.4 {tcltest -match 'a* b*'} {unixOrWin} { set result [slave msg test.tcl -match {a* b*} -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+2.+Failed.+1" $msg] @@ -220,27 +220,27 @@ test tcltest-3.5 {tcltest::match} { } # -skip, [skip] -test tcltest-4.1 {tcltest -skip 'a*'} {unixOrPc} { +test tcltest-4.1 {tcltest -skip 'a*'} {unixOrWin} { set result [slave msg test.tcl -skip a* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+0.+Skipped.+2.+Failed.+1" $msg] } {0 0 1 1 1} -test tcltest-4.2 {tcltest -skip 'b*'} {unixOrPc} { +test tcltest-4.2 {tcltest -skip 'b*'} {unixOrWin} { set result [slave msg test.tcl -skip b* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+2.+Failed.+1" $msg] } {0 1 0 1 1} -test tcltest-4.3 {tcltest -skip 'c*'} {unixOrPc} { +test tcltest-4.3 {tcltest -skip 'c*'} {unixOrWin} { set result [slave msg test.tcl -skip c* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg] } {0 1 1 0 1} -test tcltest-4.4 {tcltest -skip 'a* b*'} {unixOrPc} { +test tcltest-4.4 {tcltest -skip 'a* b*'} {unixOrWin} { set result [slave msg test.tcl -skip {a* b*} -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+0.+Skipped.+3.+Failed.+1" $msg] } {0 0 0 1 1} -test tcltest-4.5 {tcltest -match 'a* b*' -skip 'b*'} {unixOrPc} { +test tcltest-4.5 {tcltest -match 'a* b*' -skip 'b*'} {unixOrWin} { set result [slave msg test.tcl -match {a* b*} -skip b* -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg] @@ -261,12 +261,12 @@ test tcltest-4.6 {tcltest::skip} { # -constraints, -limitconstraints, [testConstraint], # $constraintsSpecified, [limitConstraints] -test tcltest-5.1 {tcltest -constraints 'knownBug'} {unixOrPc} { +test tcltest-5.1 {tcltest -constraints 'knownBug'} {unixOrWin} { set result [slave msg test.tcl -constraints knownBug -verbose 'ps'] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+2.+Skipped.+0.+Failed.+2" $msg] } {0 1 1 1 1} -test tcltest-5.2 {tcltest -constraints 'knownBug' -limitconstraints 1} {unixOrPc} { +test tcltest-5.2 {tcltest -constraints 'knownBug' -limitconstraints 1} {unixOrWin} { set result [slave msg test.tcl -constraints knownBug -verbose 'p' -limitconstraints 1] list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \ [regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg] @@ -355,7 +355,7 @@ set printerror [makeFile { } printerror.tcl] test tcltest-6.1 {tcltest -outfile, -errfile defaults} { - -constraints unixOrPc + -constraints unixOrWin -body { slave msg $printerror return $msg @@ -363,21 +363,21 @@ test tcltest-6.1 {tcltest -outfile, -errfile defaults} { -result {a test.*a really} -match regexp } -test tcltest-6.2 {tcltest -outfile a.tmp} {unixOrPc unixExecs} { +test tcltest-6.2 {tcltest -outfile a.tmp} {unixOrWin unixExecs} { slave msg $printerror -outfile a.tmp set result1 [catch {exec grep "a test" a.tmp}] set result2 [catch {exec grep "a really" a.tmp}] list [regexp "a test" $msg] [regexp "a really" $msg] \ $result1 $result2 [file exists a.tmp] [file delete a.tmp] } {0 1 0 1 1 {}} -test tcltest-6.3 {tcltest -errfile a.tmp} {unixOrPc unixExecs} { +test tcltest-6.3 {tcltest -errfile a.tmp} {unixOrWin unixExecs} { slave msg $printerror -errfile a.tmp set result1 [catch {exec grep "a test" a.tmp}] set result2 [catch {exec grep "a really" a.tmp}] list [regexp "a test" $msg] [regexp "a really" $msg] \ $result1 $result2 [file exists a.tmp] [file delete a.tmp] } {1 0 1 0 1 {}} -test tcltest-6.4 {tcltest -outfile a.tmp -errfile b.tmp} {unixOrPc unixExecs} { +test tcltest-6.4 {tcltest -outfile a.tmp -errfile b.tmp} {unixOrWin unixExecs} { slave msg $printerror -outfile a.tmp -errfile b.tmp set result1 [catch {exec grep "a test" a.tmp}] set result2 [catch {exec grep "a really" b.tmp}] @@ -464,25 +464,25 @@ test tcltest-6.8 {tcltest::outputFile (implicit outputFile)} { # Must use child processes to test -debug because it always writes # messages to stdout, and we have no way to capture stdout of a # slave interp -test tcltest-7.1 {tcltest test.tcl -debug 0} {unixOrPc} { +test tcltest-7.1 {tcltest test.tcl -debug 0} {unixOrWin} { catch {exec [interpreter] test.tcl -debug 0} msg regexp "Flags passed into tcltest" $msg } {0} -test tcltest-7.2 {tcltest test.tcl -debug 1} {unixOrPc} { +test tcltest-7.2 {tcltest test.tcl -debug 1} {unixOrWin} { catch {exec [interpreter] test.tcl -debug 1 -skip b*} msg list [regexp userSpecifiedSkip $msg] \ [regexp "Flags passed into tcltest" $msg] } {1 0} -test tcltest-7.3 {tcltest test.tcl -debug 1} {unixOrPc} { +test tcltest-7.3 {tcltest test.tcl -debug 1} {unixOrWin} { catch {exec [interpreter] test.tcl -debug 1 -match b*} msg list [regexp userSpecifiedNonMatch $msg] \ [regexp "Flags passed into tcltest" $msg] } {1 0} -test tcltest-7.4 {tcltest test.tcl -debug 2} {unixOrPc} { +test tcltest-7.4 {tcltest test.tcl -debug 2} {unixOrWin} { catch {exec [interpreter] test.tcl -debug 2} msg list [regexp "Flags passed into tcltest" $msg] [regexp "Running" $msg] } {1 0} -test tcltest-7.5 {tcltest test.tcl -debug 3} {unixOrPc} { +test tcltest-7.5 {tcltest test.tcl -debug 3} {unixOrWin} { catch {exec [interpreter] test.tcl -debug 3} msg list [regexp "Flags passed into tcltest" $msg] [regexp "Running" $msg] } {1 1} @@ -522,7 +522,7 @@ set normaldirectory [makeDirectory normaldirectory] normalizePath normaldirectory # -tmpdir, [temporaryDirectory] -test tcltest-8.1 {tcltest a.tcl -tmpdir a} -constraints unixOrPc -setup { +test tcltest-8.1 {tcltest a.tcl -tmpdir a} -constraints unixOrWin -setup { file delete -force thisdirectorydoesnotexist } -body { slave msg $a -tmpdir thisdirectorydoesnotexist @@ -531,7 +531,7 @@ test tcltest-8.1 {tcltest a.tcl -tmpdir a} -constraints unixOrPc -setup { file delete -force thisdirectorydoesnotexist } -result 1 test tcltest-8.2 {tcltest a.tcl -tmpdir thisdirectoryisafile} { - -constraints unixOrPc + -constraints unixOrWin -body { slave msg $a -tmpdir $tdiaf return $msg @@ -572,7 +572,7 @@ testConstraint notFAT [expr { }] # FAT/NTFS permissions are fairly hopeless; ignore this test if that FS is used test tcltest-8.4 {tcltest a.tcl -tmpdir notWriteableDir} { - -constraints {unixOrPc notRoot notFAT} + -constraints {unixOrWin notRoot notFAT} -body { slave msg $a -tmpdir $notWriteableDir return $msg @@ -581,7 +581,7 @@ test tcltest-8.4 {tcltest a.tcl -tmpdir notWriteableDir} { -match glob } test tcltest-8.5 {tcltest a.tcl -tmpdir normaldirectory} { - -constraints unixOrPc + -constraints unixOrWin -body { slave msg $a -tmpdir $normaldirectory # The join is necessary because the message can be split on multiple @@ -624,7 +624,7 @@ test tcltest-8.6a {temporaryDirectory - test format 2} -setup { cd [temporaryDirectory] # -testdir, [testsDirectory] test tcltest-8.10 {tcltest a.tcl -testdir thisdirectorydoesnotexist} { - -constraints unixOrPc + -constraints unixOrWin -setup { file delete -force thisdirectorydoesnotexist } @@ -636,7 +636,7 @@ test tcltest-8.10 {tcltest a.tcl -testdir thisdirectorydoesnotexist} { -result {*does not exist*} } test tcltest-8.11 {tcltest a.tcl -testdir thisdirectoryisafile} { - -constraints unixOrPc + -constraints unixOrWin -body { slave msg $a -testdir $tdiaf return $msg @@ -654,7 +654,7 @@ test tcltest-8.12 {tcltest a.tcl -testdir notReadableDir} { -result {*not readable*} } test tcltest-8.13 {tcltest a.tcl -testdir normaldirectory} { - -constraints unixOrPc + -constraints unixOrWin -body { slave msg $a -testdir $normaldirectory # The join is necessary because the message can be split on multiple @@ -731,7 +731,7 @@ removeFile thisdirectoryisafile removeDirectory normaldirectory # -file, -notfile, [matchFiles], [skipFiles] -test tcltest-9.1 {-file d*.tcl} -constraints {unixOrPc} -setup { +test tcltest-9.1 {-file d*.tcl} -constraints {unixOrWin} -setup { set old [testsDirectory] testsDirectory [file dirname [info script]] } -body { @@ -741,7 +741,7 @@ test tcltest-9.1 {-file d*.tcl} -constraints {unixOrPc} -setup { testsDirectory $old } -match regexp -result {dstring\.test} -test tcltest-9.2 {-file d*.tcl} -constraints {unixOrPc} -setup { +test tcltest-9.2 {-file d*.tcl} -constraints {unixOrWin} -setup { set old [testsDirectory] testsDirectory [file dirname [info script]] } -body { @@ -806,23 +806,23 @@ set mc [makeFile { } makecore.tcl] cd [temporaryDirectory] -test tcltest-10.1 {-preservecore 0} {unixOrPc} { +test tcltest-10.1 {-preservecore 0} {unixOrWin} { slave msg $mc -preservecore 0 file delete core regexp "Core file produced" $msg } {0} -test tcltest-10.2 {-preservecore 1} {unixOrPc} { +test tcltest-10.2 {-preservecore 1} {unixOrWin} { slave msg $mc -preservecore 1 file delete core regexp "Core file produced" $msg } {1} -test tcltest-10.3 {-preservecore 2} {unixOrPc} { +test tcltest-10.3 {-preservecore 2} {unixOrWin} { slave msg $mc -preservecore 2 file delete core list [regexp "Core file produced" $msg] [regexp "Moving file to" $msg] \ [regexp "core-" $msg] [file delete core-makecore] } {1 1 1 {}} -test tcltest-10.4 {-preservecore 3} {unixOrPc} { +test tcltest-10.4 {-preservecore 3} {unixOrWin} { slave msg $mc -preservecore 3 file delete core list [regexp "Core file produced" $msg] [regexp "Moving file to" $msg] \ @@ -853,13 +853,13 @@ set contents { } set loadfile [makeFile $contents load.tcl] -test tcltest-12.1 {-load xxx} {unixOrPc} { +test tcltest-12.1 {-load xxx} {unixOrWin} { slave msg $loadfile -load xxx return $msg } {xxx} # Using child process because of -debug usage. -test tcltest-12.2 {-loadfile load.tcl} {unixOrPc} { +test tcltest-12.2 {-loadfile load.tcl} {unixOrWin} { catch {exec [interpreter] $loadfile -debug 2 -loadfile $loadfile} msg list \ [regexp {tcltest} [join [list $msg] [split $msg \n]]] \ @@ -950,7 +950,7 @@ set allfile [makeFile { cd [workingDirectory] test tcltest-14.1 {-singleproc - single process} { - -constraints {unixOrPc} + -constraints {unixOrWin} -body { slave msg $allfile -singleproc 0 -tmpdir [temporaryDirectory] return $msg @@ -960,7 +960,7 @@ test tcltest-14.1 {-singleproc - single process} { } test tcltest-14.2 {-singleproc - multiple process} { - -constraints {unixOrPc} + -constraints {unixOrWin} -body { slave msg $allfile -singleproc 1 -tmpdir [temporaryDirectory] return $msg @@ -1024,7 +1024,7 @@ makeFile { } all.tcl $dtd3 test tcltest-15.1 {basic directory walking} { - -constraints {unixOrPc} + -constraints {unixOrWin} -body { if {[slave msg \ [file join $dtd all.tcl] \ @@ -1038,7 +1038,7 @@ test tcltest-15.1 {basic directory walking} { } test tcltest-15.2 {-asidefromdir} { - -constraints {unixOrPc} + -constraints {unixOrWin} -body { if {[slave msg \ [file join $dtd all.tcl] \ @@ -1056,7 +1056,7 @@ Error: No test files remain after applying your match and skip patterns!$} } test tcltest-15.3 {-relateddir, non-existent dir} { - -constraints {unixOrPc} + -constraints {unixOrWin} -body { if {[slave msg \ [file join $dtd all.tcl] \ @@ -1071,7 +1071,7 @@ test tcltest-15.3 {-relateddir, non-existent dir} { } test tcltest-15.4 {-relateddir, subdir} { - -constraints {unixOrPc} + -constraints {unixOrWin} -body { if {[slave msg \ [file join $dtd all.tcl] \ @@ -1084,7 +1084,7 @@ test tcltest-15.4 {-relateddir, subdir} { -result {Tests located in:.*dirtestdir2.[^23]} } test tcltest-15.5 {-relateddir, -asidefromdir} { - -constraints {unixOrPc} + -constraints {unixOrWin} -body { if {[slave msg \ [file join $dtd all.tcl] \ @@ -1173,7 +1173,7 @@ test tcltest-19.1 {TCLTEST_OPTIONS default} -setup { cd [temporaryDirectory] # PrintError -test tcltest-20.1 {PrintError} {unixOrPc} { +test tcltest-20.1 {PrintError} {unixOrWin} { set result [slave msg $printerror] list $result [regexp "Error: a really short string" $msg] \ [regexp " \"quotes\"" $msg] [regexp " \"Path" $msg] \ @@ -1409,7 +1409,7 @@ makeFile { # Must use a child process because stdout/stderr parsing can't be # duplicated in slave interp. test tcltest-22.1 {runAllTests} { - -constraints {unixOrPc} + -constraints {unixOrWin} -body { exec [interpreter] \ [file join $atd all.tcl] \ diff --git a/tests/tm.test b/tests/tm.test index 567d351..001b73e 100644 --- a/tests/tm.test +++ b/tests/tm.test @@ -200,7 +200,7 @@ test tm-3.11 {tm: module path management, remove ignores unknown path} -setup { proc genpaths {base} { # Normalizing picks up drive letters on windows [Bug 1053568] set base [file normalize $base] - lassign [split [package present Tcl] .] major minor + regexp {^(\d+)\.(\d+)} [package provide Tcl] - major minor set results {} set base [file join $base tcl$major] lappend results [file join $base site-tcl] diff --git a/tests/uplevel.test b/tests/uplevel.test index be2268a..2cbea1a 100644 --- a/tests/uplevel.test +++ b/tests/uplevel.test @@ -83,6 +83,16 @@ test uplevel-3.4 {uplevel to same level} { a1 } 55 +test uplevel-4.0.1 {error: non-existent level} -body { + uplevel #0 { uplevel { set y 222 } } +} -returnCodes error -result {bad level "1"} +test uplevel-4.0.2 {error: non-existent level} -setup { + interp create i +} -body { + i eval { uplevel { set y 222 } } +} -returnCodes error -result {bad level "1"} -cleanup { + interp delete i +} test uplevel-4.1 {error: non-existent level} -returnCodes error -body { apply {{} { uplevel #2 {set y 222} diff --git a/tests/upvar.test b/tests/upvar.test index 91153a6..a483569 100644 --- a/tests/upvar.test +++ b/tests/upvar.test @@ -304,6 +304,17 @@ test upvar-8.3 {errors in upvar command} -returnCodes error -body { proc p1 {} {upvar a b c} p1 } -result {bad level "a"} +test upvar-8.3.1 {bad level for upvar (upvar at top-level, bug [775ee88560])} -body { + proc p1 {} { uplevel { upvar b b; lappend b UNEXPECTED } } + uplevel #0 { p1 } +} -returnCodes error -result {bad level "1"} +test upvar-8.3.2 {bad level for upvar (upvar at top-level, bug [775ee88560])} -setup { + interp create i +} -body { + i eval { upvar b b; lappend b UNEXPECTED } +} -returnCodes error -result {bad level "1"} -cleanup { + interp delete i +} test upvar-8.4 {errors in upvar command} -returnCodes error -body { proc p1 {} {upvar 0 b b} p1 @@ -355,7 +366,7 @@ test upvar-8.11 {upvar will not create a variable that looks like an array} -set test upvar-9.1 {Tcl_UpVar2 procedure} testupvar { list [catch {testupvar xyz a {} x global} msg] $msg -} {1 {bad level "xyz"}} +} {1 {bad level "1"}} test upvar-9.1.1 {TclGetFrame, via Tcl_UpVar2} testupvar { apply {{} {testupvar xyz a {} x local; set x foo}} set a diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl index e851047..b38f0b5 100644 --- a/tools/tcltk-man2html-utils.tcl +++ b/tools/tcltk-man2html-utils.tcl @@ -876,7 +876,7 @@ proc insert-cross-references {text} { [expr {$offset(end-bold)-1}]] set text [string range $text[set text ""] \ [expr {$offset(end-bold)+4}] end] - regsub {http://[\w/.]+} $body {<A HREF="&">&</A>} body + regsub {http://[\w/.-]+} $body {<A HREF="&">&</A>} body append result <B> [cross-reference $body] </B> continue } @@ -912,7 +912,7 @@ proc insert-cross-references {text} { url { set off [lindex $offsets 0] append result [string range $text 0 [expr {$off-1}]] - regexp -indices -start $off {http://[\w/.]+} $text range + regexp -indices -start $off {http://[\w/.-]+} $text range set url [string range $text {*}$range] append result "<A HREF=\"[string trimright $url .]\">$url</A>" set text [string range $text[set text ""] \ diff --git a/unix/Makefile.in b/unix/Makefile.in index c62a31e..46b5ac7 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -949,7 +949,7 @@ install-libraries: libraries "$(MODULE_INSTALL_DIR)"/tcl8/8.7/msgcat-1.7.0.tm @echo "Installing package tcltest 2.5.0 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl \ - "$(MODULE_INSTALL_DIR)"/tcl8/8.5/tcltest-2.5.0.tm + "$(MODULE_INSTALL_DIR)"/tcl8/8.5/tcltest-2.5.1.tm @echo "Installing package platform 1.0.14 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl \ "$(MODULE_INSTALL_DIR)"/tcl8/8.4/platform-1.0.14.tm diff --git a/win/Makefile.in b/win/Makefile.in index 7bc4c1d..e4866cd 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -629,6 +629,12 @@ tclWinInit.${OBJEXT}: tclWinInit.c tclWinPipe.${OBJEXT}: tclWinPipe.c $(CC) -c $(CC_SWITCHES) -DBUILD_tcl $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME) +tclWinReg.${OBJEXT}: tclWinReg.c + $(CC) -c $(CC_SWITCHES) $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME) + +tclWinDde.${OBJEXT}: tclWinDde.c + $(CC) -c $(CC_SWITCHES) $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME) + testMain.${OBJEXT}: tclAppInit.c $(CC) -c $(CC_SWITCHES) -DTCL_TEST @DEPARG@ $(CC_OBJNAME) @@ -713,7 +719,7 @@ deflate.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/deflate.c ioapi.$(HOST_OBJEXT): - $(HOST_CC) -o $@ -DIOAPI_NO_64 -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/ioapi.c + $(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/ioapi.c iowin32.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/iowin32.c @@ -743,7 +749,7 @@ zutil.$(HOST_OBJEXT): $(HOST_CC) -o $@ -I$(ZLIB_DIR) -c $(ZLIB_DIR)/zutil.c minizip.$(HOST_OBJEXT): - $(HOST_CC) -o $@ -I$(ZLIB_DIR) -DIOAPI_NO_64 -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/minizip.c + $(HOST_CC) -o $@ -I$(ZLIB_DIR) -I$(ZLIB_DIR)/contrib/minizip -c $(ZLIB_DIR)/contrib/minizip/minizip.c minizip${HOST_EXEEXT}: $(MINIZIP_OBJS) $(HOST_CC) -o $@ $(MINIZIP_OBJS) @@ -869,7 +875,7 @@ install-libraries: libraries install-tzdata install-msgs @echo "Installing package msgcat 1.7.0 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.7/msgcat-1.7.0.tm; @echo "Installing package tcltest 2.4.0 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.4.0.tm; + @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.5.1.tm; @echo "Installing package platform 1.0.14 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.14.tm; @echo "Installing package platform::shell 1.1.4 as a Tcl Module"; diff --git a/win/makefile.vc b/win/makefile.vc index c2343a0..27cbc8a 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -657,7 +657,7 @@ CORE_USE_WIDECHAR_API = $(USE_WIDECHAR_API) tclConfig: $(OUT_DIR)\tclConfig.sh
# TBD - is this tclConfig.sh file ever used? The values are incorrect!
-$(OUT_DIR)\tclConfig.sh: $(WINDIR)\tclConfig.sh.in
+$(OUT_DIR)\tclConfig.sh: $(WIN_DIR)\tclConfig.sh.in
@echo Creating tclConfig.sh
@nmakehlp -s << $** >$@
@TCL_DLL_FILE@ $(TCLLIBNAME)
@@ -732,7 +732,7 @@ gendate: # Special case object file targets
#---------------------------------------------------------------------
-$(TMP_DIR)\testMain.obj: $(WINDIR)\tclAppInit.c
+$(TMP_DIR)\testMain.obj: $(WIN_DIR)\tclAppInit.c
$(cc32) $(appcflags) -DTCL_TEST \
-DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
-Fo$@ $?
@@ -747,7 +747,7 @@ $(TMP_DIR)\tclTest.obj: $(GENERICDIR)\tclTest.c $(TMP_DIR)\tclTestObj.obj: $(GENERICDIR)\tclTestObj.c
$(cc32) $(appcflags) -Fo$@ $?
-$(TMP_DIR)\tclWinTest.obj: $(WINDIR)\tclWinTest.c
+$(TMP_DIR)\tclWinTest.obj: $(WIN_DIR)\tclWinTest.c
$(CCAPPCMD) $?
$(TMP_DIR)\tclZipfs.obj: $(GENERICDIR)\tclZipfs.c
@@ -772,14 +772,14 @@ $(TMP_DIR)\tclPkgConfig.obj: $(GENERICDIR)\tclPkgConfig.c -DCFG_RUNTIME_ZIPFILE="\"$(CFG_RUNTIME_ZIPFILE:\=\\)\"" \
-Fo$@ $?
-$(TMP_DIR)\tclAppInit.obj: $(WINDIR)\tclAppInit.c
+$(TMP_DIR)\tclAppInit.obj: $(WIN_DIR)\tclAppInit.c
$(cc32) $(appcflags) \
-DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
-Fo$@ $?
### The following objects should be built using the stub interfaces
-$(TMP_DIR)\tclWinReg.obj: $(WINDIR)\tclWinReg.c
+$(TMP_DIR)\tclWinReg.obj: $(WIN_DIR)\tclWinReg.c
!if $(STATIC_BUILD)
$(cc32) $(appcflags) -DSTATIC_BUILD -Fo$@ $?
!else
@@ -787,7 +787,7 @@ $(TMP_DIR)\tclWinReg.obj: $(WINDIR)\tclWinReg.c !endif
-$(TMP_DIR)\tclWinDde.obj: $(WINDIR)\tclWinDde.c
+$(TMP_DIR)\tclWinDde.obj: $(WIN_DIR)\tclWinDde.c
!if $(STATIC_BUILD)
$(cc32) $(appcflags) -DSTATIC_BUILD -Fo$@ $?
!else
@@ -808,10 +808,10 @@ $(TMP_DIR)\tclTomMathStubLib.obj: $(GENERICDIR)\tclTomMathStubLib.c $(TMP_DIR)\tclOOStubLib.obj: $(GENERICDIR)\tclOOStubLib.c
$(cc32) $(stubscflags) -Fo$@ $?
-$(TMP_DIR)\tclWinPanic.obj: $(WINDIR)\tclWinPanic.c
+$(TMP_DIR)\tclWinPanic.obj: $(WIN_DIR)\tclWinPanic.c
$(cc32) $(stubscflags) -Fo$@ $?
-$(TMP_DIR)\tclsh.exe.manifest: $(WINDIR)\tclsh.exe.manifest.in
+$(TMP_DIR)\tclsh.exe.manifest: $(WIN_DIR)\tclsh.exe.manifest.in
@nmakehlp -s << $** >$@
@MACHINE@ $(MACHINE:IX86=X86)
@TCL_WIN_VERSION@ $(DOTVERSION).0.0
@@ -831,7 +831,7 @@ depend: !else
$(TCLSH) $(TOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
-passthru:"-DBUILD_tcl $(TCL_INCLUDES) $(PRJ_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \
- $(COMPATDIR),$$(COMPATDIR) $(TOMMATHDIR),$$(TOMMATHDIR) $(WINDIR),$$(WINDIR) @<<
+ $(COMPATDIR),$$(COMPATDIR) $(TOMMATHDIR),$$(TOMMATHDIR) $(WIN_DIR),$$(WIN_DIR) @<<
$(TCLOBJS)
<<
!endif
@@ -868,7 +868,7 @@ $< $<
<<
-$(TMP_DIR)\tclsh.res: $(TMP_DIR)\tclsh.exe.manifest $(WINDIR)\tclsh.rc
+$(TMP_DIR)\tclsh.res: $(TMP_DIR)\tclsh.exe.manifest $(WIN_DIR)\tclsh.rc
#---------------------------------------------------------------------
@@ -928,10 +928,10 @@ install-libraries: tclConfig tcl-nmake install-msgs install-tzdata @$(CPY) "$(ROOT)\library\word.tcl" "$(SCRIPT_INSTALL_DIR)\"
@$(CPY) "$(ROOT)\library\auto.tcl" "$(SCRIPT_INSTALL_DIR)\"
@$(CPY) "$(OUT_DIR)\tclConfig.sh" "$(LIB_INSTALL_DIR)\"
- @$(CPY) "$(WINDIR)\tclooConfig.sh" "$(LIB_INSTALL_DIR)\"
- @$(CPY) "$(WINDIR)\rules.vc" "$(LIB_INSTALL_DIR)\nmake\"
- @$(CPY) "$(WINDIR)\targets.vc" "$(LIB_INSTALL_DIR)\nmake\"
- @$(CPY) "$(WINDIR)\nmakehlp.c" "$(LIB_INSTALL_DIR)\nmake\"
+ @$(CPY) "$(WIN_DIR)\tclooConfig.sh" "$(LIB_INSTALL_DIR)\"
+ @$(CPY) "$(WIN_DIR)\rules.vc" "$(LIB_INSTALL_DIR)\nmake\"
+ @$(CPY) "$(WIN_DIR)\targets.vc" "$(LIB_INSTALL_DIR)\nmake\"
+ @$(CPY) "$(WIN_DIR)\nmakehlp.c" "$(LIB_INSTALL_DIR)\nmake\"
@$(CPY) "$(OUT_DIR)\tcl.nmake" "$(LIB_INSTALL_DIR)\nmake\"
@echo Installing library opt0.4 directory
@$(CPY) "$(ROOT)\library\opt\*.tcl" \
diff --git a/win/rules.vc b/win/rules.vc index b683651..8487e41 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -162,7 +162,7 @@ MKDIR = mkdir # COMPATDIR - source directory that holds compatibility sources
# DOCDIR - source directory containing documentation files
# GENERICDIR - platform-independent source directory
-# WINDIR - Windows-specific source directory
+# WIN_DIR - Windows-specific source directory
# TESTDIR - directory containing test files
# TOOLSDIR - directory containing build tools
# _TCLDIR - root of the Tcl installation OR the Tcl sources. Not set
@@ -215,17 +215,15 @@ DEMODIR = $(LIBDIR)\demos DEMODIR = $(ROOT)\demos
!endif
!endif # ifndef DEMODIR
-# Do NOT enclose WINDIR in a !ifndef because Windows always defines
-# WINDIR env var to point to c:\windows!
-# TBD - This is a potentially dangerous conflict, rename WINDIR to
-# something else
-WINDIR = $(ROOT)\win
+# Do NOT use WINDIR because it is Windows internal environment
+# variable to point to c:\windows!
+WIN_DIR = $(ROOT)\win
!ifndef RCDIR
-!if exist("$(WINDIR)\rc")
-RCDIR = $(WINDIR)\rc
+!if exist("$(WIN_DIR)\rc")
+RCDIR = $(WIN_DIR)\rc
!else
-RCDIR = $(WINDIR)
+RCDIR = $(WIN_DIR)
!endif
!endif
RCDIR = $(RCDIR:/=\)
@@ -1084,7 +1082,7 @@ TCLLIB = $(OUT_DIR)\$(TCLLIBNAME) TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME)
-TCL_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)"
+TCL_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)"
!else # ! $(DOING_TCL)
@@ -1159,7 +1157,7 @@ WISH = $(OUT_DIR)\$(WISHNAME) TKSTUBLIB = $(OUT_DIR)\$(TKSTUBLIBNAME)
TKIMPLIB = $(OUT_DIR)\$(TKIMPLIBNAME)
TKLIB = $(OUT_DIR)\$(TKLIBNAME)
-TK_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)"
+TK_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)"
!else # effectively NEED_TK
@@ -1411,7 +1409,7 @@ cwarn = $(cwarn) -WX INCLUDES = $(TCL_INCLUDES) $(TK_INCLUDES) $(PRJ_INCLUDES)
!if !$(DOING_TCL) && !$(DOING_TK)
-INCLUDES = $(INCLUDES) -I"$(GENERICDIR)" -I"$(WINDIR)" -I"$(COMPATDIR)"
+INCLUDES = $(INCLUDES) -I"$(GENERICDIR)" -I"$(WIN_DIR)" -I"$(COMPATDIR)"
!endif
# These flags are defined roughly in the order of the pre-reform
@@ -1593,20 +1591,20 @@ default-install-demos: default-clean:
@echo Cleaning $(TMP_DIR)\* ...
@if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR)
- @echo Cleaning $(WINDIR)\nmakehlp.obj, nmakehlp.exe ...
- @if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj
- @if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe
- @if exist $(WINDIR)\nmakehlp.out del $(WINDIR)\nmakehlp.out
- @echo Cleaning $(WINDIR)\nmhlp-out.txt ...
- @if exist $(WINDIR)\nmhlp-out.txt del $(WINDIR)\nmhlp-out.txt
- @echo Cleaning $(WINDIR)\_junk.pch ...
- @if exist $(WINDIR)\_junk.pch del $(WINDIR)\_junk.pch
- @echo Cleaning $(WINDIR)\vercl.x, vercl.i ...
- @if exist $(WINDIR)\vercl.x del $(WINDIR)\vercl.x
- @if exist $(WINDIR)\vercl.i del $(WINDIR)\vercl.i
- @echo Cleaning $(WINDIR)\versions.vc, version.vc ...
- @if exist $(WINDIR)\versions.vc del $(WINDIR)\versions.vc
- @if exist $(WINDIR)\version.vc del $(WINDIR)\version.vc
+ @echo Cleaning $(WIN_DIR)\nmakehlp.obj, nmakehlp.exe ...
+ @if exist $(WIN_DIR)\nmakehlp.obj del $(WIN_DIR)\nmakehlp.obj
+ @if exist $(WIN_DIR)\nmakehlp.exe del $(WIN_DIR)\nmakehlp.exe
+ @if exist $(WIN_DIR)\nmakehlp.out del $(WIN_DIR)\nmakehlp.out
+ @echo Cleaning $(WIN_DIR)\nmhlp-out.txt ...
+ @if exist $(WIN_DIR)\nmhlp-out.txt del $(WIN_DIR)\nmhlp-out.txt
+ @echo Cleaning $(WIN_DIR)\_junk.pch ...
+ @if exist $(WIN_DIR)\_junk.pch del $(WIN_DIR)\_junk.pch
+ @echo Cleaning $(WIN_DIR)\vercl.x, vercl.i ...
+ @if exist $(WIN_DIR)\vercl.x del $(WIN_DIR)\vercl.x
+ @if exist $(WIN_DIR)\vercl.i del $(WIN_DIR)\vercl.i
+ @echo Cleaning $(WIN_DIR)\versions.vc, version.vc ...
+ @if exist $(WIN_DIR)\versions.vc del $(WIN_DIR)\versions.vc
+ @if exist $(WIN_DIR)\version.vc del $(WIN_DIR)\version.vc
default-hose: default-clean
@echo Hosing $(OUT_DIR)\* ...
@@ -1698,7 +1696,7 @@ DISABLE_IMPLICIT_RULES = 0 $<
<<
-{$(WINDIR)}.c{$(TMP_DIR)}.obj::
+{$(WIN_DIR)}.c{$(TMP_DIR)}.obj::
$(CCPKGCMD) @<<
$<
<<
@@ -1716,7 +1714,7 @@ $< {$(RCDIR)}.rc{$(TMP_DIR)}.res:
$(RESCMD) $<
-{$(WINDIR)}.rc{$(TMP_DIR)}.res:
+{$(WIN_DIR)}.rc{$(TMP_DIR)}.res:
$(RESCMD) $<
{$(TMP_DIR)}.rc{$(TMP_DIR)}.res:
diff --git a/win/tclWinPort.h b/win/tclWinPort.h index 1a5ce36..35f183c 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -14,14 +14,10 @@ #ifndef _TCLWINPORT #define _TCLWINPORT -/* define _USE_64BIT_TIME_T (or make/configure option time64bit) to force 64-bit time_t */ -#if defined(_USE_64BIT_TIME_T) -#define __MINGW_USE_VC2005_COMPAT -#endif #if !defined(_WIN64) && !defined(__MINGW_USE_VC2005_COMPAT) /* See [Bug 3354324]: file mtime sets wrong time */ -# define _USE_32BIT_TIME_T +# define __MINGW_USE_VC2005_COMPAT #endif /* diff --git a/win/tclWinTest.c b/win/tclWinTest.c index ffae7af..3b71a3e 100644 --- a/win/tclWinTest.c +++ b/win/tclWinTest.c @@ -333,9 +333,14 @@ TestSizeCmd( Tcl_SetObjResult(interp, Tcl_NewWideIntObj(sizeof(time_t))); return TCL_OK; } + if (strcmp(Tcl_GetString(objv[1]), "st_mtime") == 0) { + Tcl_StatBuf *statPtr; + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(sizeof(statPtr->st_mtime))); + return TCL_OK; + } syntax: - Tcl_WrongNumArgs(interp, 1, objv, "time_t"); + Tcl_WrongNumArgs(interp, 1, objv, "time_t|st_mtime"); return TCL_ERROR; } diff --git a/win/tclWinTime.c b/win/tclWinTime.c index 39e1100..2b6d60b 100644 --- a/win/tclWinTime.c +++ b/win/tclWinTime.c @@ -740,6 +740,11 @@ TclpGetDate( { struct tm *tmPtr; time_t time; +#if defined(_WIN64) || (defined(_USE_64BIT_TIME_T) || (defined(_MSC_VER) && _MSC_VER < 1400)) +# define t2 *t /* no need to cripple time to 32-bit */ +#else + time_t t2 = *(__time32_t *)t; +#endif if (!useGMT) { #if defined(_MSC_VER) && (_MSC_VER >= 1900) @@ -772,15 +777,15 @@ TclpGetDate( #define LOCALTIME_VALIDITY_BOUNDARY 0 #endif - if (*t >= LOCALTIME_VALIDITY_BOUNDARY) { - return TclpLocaltime(t); + if (t2 >= LOCALTIME_VALIDITY_BOUNDARY) { + return TclpLocaltime(&t2); } #if defined(_MSC_VER) && (_MSC_VER >= 1900) _get_timezone(&timezone); #endif - time = *t - timezone; + time = t2 - timezone; /* * If we aren't near to overflowing the long, just add the bias and @@ -788,10 +793,10 @@ TclpGetDate( * result at the end. */ - if (*t < (LONG_MAX - 2*SECSPERDAY) && *t > (LONG_MIN + 2*SECSPERDAY)) { + if (t2 < (LONG_MAX - 2*SECSPERDAY) && t2 > (LONG_MIN + 2*SECSPERDAY)) { tmPtr = ComputeGMT(&time); } else { - tmPtr = ComputeGMT(t); + tmPtr = ComputeGMT(&t2); tzset(); @@ -827,7 +832,7 @@ TclpGetDate( tmPtr->tm_wday = (tmPtr->tm_wday + (int)time) % 7; } } else { - tmPtr = ComputeGMT(t); + tmPtr = ComputeGMT(&t2); } return tmPtr; } @@ -1364,7 +1369,11 @@ TclpGmtime( * Posix gmtime_r function. */ +#if defined(_WIN64) || defined(_USE_64BIT_TIME_T) || (defined(_MSC_VER) && _MSC_VER < 1400) return gmtime(timePtr); +#else + return _gmtime32((CONST __time32_t *)timePtr); +#endif } /* @@ -1395,7 +1404,11 @@ TclpLocaltime( * provide a Posix localtime_r function. */ +#if defined(_WIN64) || defined(_USE_64BIT_TIME_T) || (defined(_MSC_VER) && _MSC_VER < 1400) return localtime(timePtr); +#else + return _localtime32((CONST __time32_t *)timePtr); +#endif } #endif /* TCL_NO_DEPRECATED */ |