From e326690201a1c304d6f3270988e781f00372b72a Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 14 Nov 2018 17:52:35 +0000 Subject: Bump to version 8.7a3 for release. --- generic/tcl.h | 8 ++------ library/init.tcl | 2 +- unix/configure | 2 +- unix/configure.ac | 2 +- unix/tcl.spec | 2 +- win/configure | 2 +- win/configure.ac | 2 +- 7 files changed, 8 insertions(+), 12 deletions(-) diff --git a/generic/tcl.h b/generic/tcl.h index b6d7017..16ebb8b 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -42,10 +42,6 @@ extern "C" { * win/configure.ac (as above) * win/tcl.m4 (not patchlevel) * README (sections 0 and 2, with and without separator) - * macosx/Tcl.pbproj/project.pbxproj (not patchlevel) 1 LOC - * macosx/Tcl.pbproj/default.pbxuser (not patchlevel) 1 LOC - * macosx/Tcl.xcode/project.pbxproj (not patchlevel) 2 LOC - * macosx/Tcl.xcode/default.pbxuser (not patchlevel) 1 LOC * macosx/Tcl-Common.xcconfig (not patchlevel) 1 LOC * win/README (not patchlevel) (sections 0 and 2) * unix/tcl.spec (1 LOC patch) @@ -55,10 +51,10 @@ extern "C" { #define TCL_MAJOR_VERSION 8 #define TCL_MINOR_VERSION 7 #define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE -#define TCL_RELEASE_SERIAL 2 +#define TCL_RELEASE_SERIAL 3 #define TCL_VERSION "8.7" -#define TCL_PATCH_LEVEL "8.7a2" +#define TCL_PATCH_LEVEL "8.7a3" #if !defined(TCL_NO_DEPRECATED) || defined(RC_INVOKED) /* diff --git a/library/init.tcl b/library/init.tcl index 1221e61..1511384 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -19,7 +19,7 @@ if {[info commands package] == ""} { error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" } -package require -exact Tcl 8.7a2 +package require -exact Tcl 8.7a3 # Compute the auto path to use in this interpreter. # The values on the path come from several locations: diff --git a/unix/configure b/unix/configure index d963fbe..73e3004 100755 --- a/unix/configure +++ b/unix/configure @@ -2382,7 +2382,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TCL_VERSION=8.7 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=7 -TCL_PATCH_LEVEL="a2" +TCL_PATCH_LEVEL="a3" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/configure.ac b/unix/configure.ac index f34091f..48e2e30 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TCL_VERSION=8.7 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=7 -TCL_PATCH_LEVEL="a2" +TCL_PATCH_LEVEL="a3" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/tcl.spec b/unix/tcl.spec index 265e4df..e148f36 100644 --- a/unix/tcl.spec +++ b/unix/tcl.spec @@ -4,7 +4,7 @@ Name: tcl Summary: Tcl scripting language development environment -Version: 8.7a2 +Version: 8.7a3 Release: 2 License: BSD Group: Development/Languages diff --git a/win/configure b/win/configure index 21c3cc7..f2d30c9 100755 --- a/win/configure +++ b/win/configure @@ -2110,7 +2110,7 @@ SHELL=/bin/sh TCL_VERSION=8.7 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=7 -TCL_PATCH_LEVEL="a2" +TCL_PATCH_LEVEL="a3" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 diff --git a/win/configure.ac b/win/configure.ac index 7b63c61..7077045 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -14,7 +14,7 @@ SHELL=/bin/sh TCL_VERSION=8.7 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=7 -TCL_PATCH_LEVEL="a2" +TCL_PATCH_LEVEL="a3" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 -- cgit v0.12 From c3c72d902fa9b52894c30671758bfd15765163e4 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 17 Jun 2019 18:56:40 +0000 Subject: Bump version numbers for 8.6.10 release. --- README.md | 2 +- generic/tcl.h | 4 ++-- library/init.tcl | 2 +- unix/configure | 2 +- unix/configure.in | 2 +- unix/tcl.spec | 2 +- win/configure | 2 +- win/configure.in | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ae0a833..3f05cf6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # README: Tcl -This is the **Tcl 8.6.9** source distribution. +This is the **Tcl 8.6.10** source distribution. You can get any source release of Tcl from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). diff --git a/generic/tcl.h b/generic/tcl.h index 17ab2d3..d6e6375 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -51,10 +51,10 @@ extern "C" { #define TCL_MAJOR_VERSION 8 #define TCL_MINOR_VERSION 6 #define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TCL_RELEASE_SERIAL 9 +#define TCL_RELEASE_SERIAL 10 #define TCL_VERSION "8.6" -#define TCL_PATCH_LEVEL "8.6.9" +#define TCL_PATCH_LEVEL "8.6.10" /* *---------------------------------------------------------------------------- diff --git a/library/init.tcl b/library/init.tcl index 8952172..2b63474 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -16,7 +16,7 @@ if {[info commands package] == ""} { error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" } -package require -exact Tcl 8.6.9 +package require -exact Tcl 8.6.10 # Compute the auto path to use in this interpreter. # The values on the path come from several locations: diff --git a/unix/configure b/unix/configure index 159a21b..f875d0b 100755 --- a/unix/configure +++ b/unix/configure @@ -1335,7 +1335,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".9" +TCL_PATCH_LEVEL=".10" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/configure.in b/unix/configure.in index 61e408f..78d710c 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".9" +TCL_PATCH_LEVEL=".10" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/tcl.spec b/unix/tcl.spec index cc36790..e050a30 100644 --- a/unix/tcl.spec +++ b/unix/tcl.spec @@ -4,7 +4,7 @@ Name: tcl Summary: Tcl scripting language development environment -Version: 8.6.9 +Version: 8.6.10 Release: 2 License: BSD Group: Development/Languages diff --git a/win/configure b/win/configure index 3024594..87d950b 100755 --- a/win/configure +++ b/win/configure @@ -1311,7 +1311,7 @@ SHELL=/bin/sh TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".9" +TCL_PATCH_LEVEL=".10" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 diff --git a/win/configure.in b/win/configure.in index 511cb39..bdc76ce 100644 --- a/win/configure.in +++ b/win/configure.in @@ -14,7 +14,7 @@ SHELL=/bin/sh TCL_VERSION=8.6 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=6 -TCL_PATCH_LEVEL=".9" +TCL_PATCH_LEVEL=".10" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 -- cgit v0.12 From 65e3c9b74dc5e0c66191484c4b8dba676f01286b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 27 Jun 2019 13:29:40 +0000 Subject: Fix execute flag for win/tclWinFile.c here too --- win/tclWinFile.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 win/tclWinFile.c diff --git a/win/tclWinFile.c b/win/tclWinFile.c old mode 100755 new mode 100644 -- cgit v0.12 From 2e674796fc59d1c596c8d3e6a6e58b35454b92c8 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 7 Oct 2019 18:49:56 +0000 Subject: changes WIP --- changes | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/changes b/changes index 8d6db7d..664e2f9 100644 --- a/changes +++ b/changes @@ -8894,3 +8894,23 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) 2018-11-16 (bug)[00d04c] Repair [binary encode base64] (sebres) - Released 8.6.9, November 16, 2018 - details at http://core.tcl-lang.org/tcl/ - + +2018-11-22 (bug)[7a9dc5] [file normalize ~/~foo] segfault (sebres) + +2018-12-30 (bug)[3cf3a9] variable 'timezone' deprecated in vc2017 (nijtmans) + +2019-01-09 (bug)[cc1e91] [list [list {*}[set a " "]]] regression (sebres) + + + + + + + + + + + + + +- Released 8.6.10, October 15, 2018 - details at http://core.tcl-lang.org/tcl/ - -- cgit v0.12 From fe24e890ab20ce41c96b9ed028157091620a6dc4 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 21 Oct 2019 17:33:46 +0000 Subject: More progress on changes. --- changes | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/changes b/changes index 664e2f9..093f387 100644 --- a/changes +++ b/changes @@ -8901,8 +8901,37 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) 2019-01-09 (bug)[cc1e91] [list [list {*}[set a " "]]] regression (sebres) +2019-02-01 (bug)[e3f481] tests var-1.2[01] (sebres) +2019-02-01 (new) libtommath updated to release 1.1.0 (nijtmans) +2019-03-01 (new) Update to Unicode 12.0 (nijtmans) + +2019-03-05 (new)[TIP 527] New command [timerate] (sebres) + +2019-03-08 (bug)[39fed4] [package require] memory validity (hume,porter) + +2019-04-23 (new) New command tcl::unsupported::corotype (fellows) + +2019-05-04 (bug) memlink when namespace deletion kills linked var (porter) + +2019-05-28 (new) README file converted to README.md in Markdown (nijtmans) + +2019-06-17 (bug)[8b9854] [info level 0] regression with ensembles (porter) + +2019-06-20 (bug)[6bdadf] crash multi-arg write-traced [lappend] (fellows,porter) + +2019-06-21 (bug)[f8a33c] crash Tcl_Exit before init (brooks,sebres) + +2019-08-27 (bug)[fa6bf3] Bytecode fails epoch recovery at numLevel=0 (sebres) + +2019-08-29 (bug)[fec0c1] C stack overflow compiling bytecode (ade,sebres) + +2019-09-12 tzdata updated to Olson's tzdata2019c (jima) + +2019-09-20 (new) registry/dde no longer need -DUNICODE (nijtmans) +=> registry 1.3.4 +=> dde 1.4.2 -- cgit v0.12 From 18c563f16151c45cf1099f130e3799c24bc2d11f Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 21 Oct 2019 19:03:51 +0000 Subject: Complete draft changes. --- changes | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/changes b/changes index 093f387..f034b02 100644 --- a/changes +++ b/changes @@ -8933,13 +8933,6 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) => registry 1.3.4 => dde 1.4.2 +2019-10-02 (bug)[16768d] Fix [info hostname] on NetBSD (rytaro) - - - - - - - - -- Released 8.6.10, October 15, 2018 - details at http://core.tcl-lang.org/tcl/ - +- Released 8.6.10, October 25, 2019 - details at http://core.tcl-lang.org/tcl/ - -- cgit v0.12 From 507395df2ce580c9c0048b0f8a94c19d4d8b9dd6 Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sun, 27 Oct 2019 22:24:39 +0000 Subject: Tweak README --- macosx/README | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/macosx/README b/macosx/README index b0278b1..caae3e0 100644 --- a/macosx/README +++ b/macosx/README @@ -36,8 +36,8 @@ Weak-linking is available on OS X 10.2 or later, it additionally allows Tcl built on 10.x to run on any 10.y with x > y >= z (for a chosen z >= 2). - Tcl extensions can be installed in any of: - $HOME/Library/Tcl /Library/Tcl /System/Library/Tcl - $HOME/Library/Frameworks /Library/Frameworks /System/Library/Frameworks + $HOME/Library/Tcl /Library/Tcl + $HOME/Library/Frameworks /Library/Frameworks (searched in that order). Given a potential package directory $pkg, Tcl on OSX checks for the file $pkg/Resources/Scripts/pkgIndex.tcl as well as the usual $pkg/pkgIndex.tcl. @@ -57,7 +57,7 @@ No nroff manpages are installed by default by the GNUmakefile. - The Tcl framework can be installed in any of the system's standard framework directories: - $HOME/Library/Frameworks /Library/Frameworks /System/Library/Frameworks + $HOME/Library/Frameworks /Library/Frameworks 3. Building Tcl on Mac OS X -- cgit v0.12 From f594ed900cf74888e871d30ba1fb8091e846d5db Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 28 Oct 2019 17:18:01 +0000 Subject: update changes --- changes | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changes b/changes index 777923e..46fe5b7 100644 --- a/changes +++ b/changes @@ -8935,4 +8935,8 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) 2019-10-23 (new) libtommath updated to release 1.2.0 (nijtmans) +2019-10-25 OSX: system Tcl deprecated. End default use of its packages. (walzer) + +2019-10-28 (bug)[bcd100] bad fs cache when system encoding changes (coulter) + - Released 8.6.10, October 25, 2019 - details at http://core.tcl-lang.org/tcl/ - -- cgit v0.12 From 8bc7833ed365e1fb5aca245e10ad0287b7d9551a Mon Sep 17 00:00:00 2001 From: dgp Date: Sat, 2 Nov 2019 17:40:08 +0000 Subject: bump release date --- changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes b/changes index 46fe5b7..91ddf32 100644 --- a/changes +++ b/changes @@ -8939,4 +8939,4 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) 2019-10-28 (bug)[bcd100] bad fs cache when system encoding changes (coulter) -- Released 8.6.10, October 25, 2019 - details at http://core.tcl-lang.org/tcl/ - +- Released 8.6.10, November 7, 2019 - details at http://core.tcl-lang.org/tcl/ - -- cgit v0.12 From 0db44b051693cc2e28ad179970f04fd317259e90 Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 3 Nov 2019 02:17:02 +0000 Subject: Fix test failures with -singleproc 1 testing --- tests/fileSystemEncoding.test | 3 ++- tests/tcltests.tcl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/fileSystemEncoding.test b/tests/fileSystemEncoding.test index 3679652..da301ce 100644 --- a/tests/fileSystemEncoding.test +++ b/tests/fileSystemEncoding.test @@ -38,11 +38,12 @@ namespace eval ::tcl::test::fileSystemEncoding { makeFile {} $utf8name set globbed [lindex [glob -directory $dir *] 0] encoding system utf-8 - lappend res [file exists $globbed] + set res [file exists $globbed] encoding system iso8859-1 lappend res [file exists $globbed] return $res } -cleanup { + removeFile $utf8name file delete -force $dir encoding system $saved } -result {0 1} diff --git a/tests/tcltests.tcl b/tests/tcltests.tcl index 35b7005..a1fdb3d 100644 --- a/tests/tcltests.tcl +++ b/tests/tcltests.tcl @@ -24,7 +24,7 @@ namespace eval ::tcltests { proc tempdir_alternate {} { - file tempfile tempfile + close [file tempfile tempfile] set tmpdir [file dirname $tempfile] set execname [info nameofexecutable] regsub -all {[^[:alpha:][:digit:]]} $execname _ execname -- cgit v0.12 From bbbc406887aeb5d5575679cca50c566d7919433f Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 3 Nov 2019 02:25:43 +0000 Subject: Updates from `make dist` --- unix/tclConfig.h.in | 26 ++++++-------------------- win/configure | 22 ++++++++++------------ 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in index 2aa3bb8..ce9c8d0 100644 --- a/unix/tclConfig.h.in +++ b/unix/tclConfig.h.in @@ -4,9 +4,6 @@ #ifndef _TCLCONFIG #define _TCLCONFIG -/* Define if building universal (internal helper macro) */ -#undef AC_APPLE_UNIVERSAL_BUILD - /* Is gettimeofday() actually declared in ? */ #undef GETTOD_NOT_DECLARED @@ -222,10 +219,10 @@ /* Is 'struct stat64' in ? */ #undef HAVE_STRUCT_STAT64 -/* Define to 1 if `st_blksize' is a member of `struct stat'. */ +/* Define to 1 if `st_blksize' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE -/* Define to 1 if `st_blocks' is a member of `struct stat'. */ +/* Define to 1 if `st_blocks' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLOCKS /* Define to 1 if you have the header file. */ @@ -366,9 +363,6 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME -/* Define to the home page for this package. */ -#undef PACKAGE_URL - /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -447,17 +441,9 @@ /* Should we use vfork() instead of fork()? */ #undef USE_VFORK -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -# undef WORDS_BIGENDIAN -# endif -#endif +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN /* Are Darwin SUSv3 extensions available? */ #undef _DARWIN_C_SOURCE @@ -512,7 +498,7 @@ /* Define to `int' if does not define. */ #undef pid_t -/* Define to `unsigned int' if does not define. */ +/* Define to `unsigned' if does not define. */ #undef size_t /* Define as int if socklen_t is not available */ diff --git a/win/configure b/win/configure index c6f95f5..abefbb3 100755 --- a/win/configure +++ b/win/configure @@ -3018,26 +3018,24 @@ fi echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set x ${MAKE-make} -ac_make=`echo "" | sed 'y,:./+-,___p_,'` +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF -SHELL = /bin/sh all: - @echo '@@@%%%=$(MAKE)=@@@%%%' + @echo 'ac_maketemp="$(MAKE)"' _ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi rm -f conftest.make fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= -- cgit v0.12 From 25091201d6aa1b0dd1db88acd0ec55e67490405d Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 4 Nov 2019 12:03:56 +0000 Subject: Fix travis build on Windows (tweak to configure script was made on purpose, to workaround a bug in autoconf-2.59) --- win/configure | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/win/configure b/win/configure index abefbb3..c6f95f5 100755 --- a/win/configure +++ b/win/configure @@ -3018,24 +3018,26 @@ fi echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +set x ${MAKE-make} +ac_make=`echo "" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= -- cgit v0.12 From f8d95ed6e3a9e4629689601f90db1b78fe050c76 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 5 Nov 2019 14:15:09 +0000 Subject: Bump release date to Nov 21 --- changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes b/changes index 91ddf32..1e3f3a2 100644 --- a/changes +++ b/changes @@ -8939,4 +8939,4 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) 2019-10-28 (bug)[bcd100] bad fs cache when system encoding changes (coulter) -- Released 8.6.10, November 7, 2019 - details at http://core.tcl-lang.org/tcl/ - +- Released 8.6.10, November 21, 2019 - details at http://core.tcl-lang.org/tcl/ - -- cgit v0.12 From 7f6aa30c40530953b486bf8187ba1b888bc23ab6 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 5 Nov 2019 17:52:33 +0000 Subject: Bump release date --- changes | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/changes b/changes index 2ce48bd..d1296b0 100644 --- a/changes +++ b/changes @@ -8949,4 +8949,20 @@ in this changeset (new minor version) rather than bug fixes: 2018-03-12 (TIP 499) custom locale preference list (oehlmann) => msgcat 1.7.0 -- Released 8.7a3, Nov 30, 2018 --- http://core.tcl-lang.org/tcl/ for details - + + + + + + + + + + + + + + + + +- Released 8.7a3, Nov 21, 2019 --- http://core.tcl-lang.org/tcl/ for details - -- cgit v0.12 From 3b028ddc036e831f37393e6cba560a18528611dc Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 8 Nov 2019 15:11:42 +0000 Subject: Start updates to changes --- changes | 109 ++++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 79 insertions(+), 30 deletions(-) diff --git a/changes b/changes index d1296b0..1bbcf91 100644 --- a/changes +++ b/changes @@ -8796,6 +8796,55 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) --- Released 8.6.7, August 9, 2017 --- https://core.tcl-lang.org/tcl/ for details +Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7, +plus the following, which focuses on the high-level feature changes +in this changeset (new minor version) rather than bug fixes: + +2016-03-17 (bug)[0b8c38] socket accept callbacks always in global ns (porter) + *** POTENTIAL INCOMPATIBILITY *** + +2016-07-01 Hack accommodations for legacy Itcl 3 disabled (porter) + +2016-07-12 Make TCL_HASH_TYPE build-time configurable (nijtmans) + +2016-07-19 (bug)[0363f0] Partial array search ID reform (porter) + +2016-07-19 (feature removed) Tcl_ObjType "array search" unregistered (porter) + *** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("array search") *** + +2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max) + +2016-11-25 [array names -regexp] supports backrefs (goth) + +2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy) + +2017-01-04 (TIP 459) New subcommand [package files] (nijtmans) + +2017-01-16 threaded allocator initialization repair (vasiljevic,nijtmans) + +2017-01-30 Add to Win shell builtins: assoc ftype move (ashok) + +2017-03-31 TCL_MEM_DEBUG facilities better support 64-bit memory (nijtmans) + +2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans) + +2017-05-18 (TIP 458) New epoll or kqueue notifiers are default (alborboz) + +2017-05-31 Purge build support for SunOS-4.* (stu) + +2017-06-22 (TIP 463) New option [regsub ... -command ...] (fellows) + +2017-06-22 (TIP 470) Tcl_GetDefineContextObject();[oo::define [self]] (fellows) +=> TclOO 1.2.0 + +2017-06-23 (TIP 472) Support 0d as prefix of decimal numbers (iyer,griffin) + +2017-08-31 (bug)[2a9465] http state 100 continue handling broken (oehlmann) + +2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter) + +--- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details + 2017-08-10 [array names -regexp] supports backrefs (goth) 2017-08-10 Fix gcc build failures due to #pragma placement (cassoff,fellows) @@ -8895,59 +8944,56 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich) - Released 8.6.9, November 16, 2018 - details at http://core.tcl-lang.org/tcl/ - -Changes to 8.7a1 include all changes to the 8.6 line through 8.6.7, -plus the following, which focuses on the high-level feature changes -in this changeset (new minor version) rather than bug fixes: +2018-11-22 (bug)[7a9dc5] [file normalize ~/~foo] segfault (sebres) -2016-03-17 (bug)[0b8c38] socket accept callbacks always in global ns (porter) - *** POTENTIAL INCOMPATIBILITY *** +2018-12-30 (bug)[3cf3a9] variable 'timezone' deprecated in vc2017 (nijtmans) -2016-07-01 Hack accommodations for legacy Itcl 3 disabled (porter) +2019-01-09 (bug)[cc1e91] [list [list {*}[set a " "]]] regression (sebres) -2016-07-12 Make TCL_HASH_TYPE build-time configurable (nijtmans) +2019-02-01 (bug)[e3f481] tests var-1.2[01] (sebres) -2016-07-19 (bug)[0363f0] Partial array search ID reform (porter) +2019-03-01 (new) Update to Unicode 12.0 (nijtmans) -2016-07-19 (feature removed) Tcl_ObjType "array search" unregistered (porter) - *** POTENTIAL INCOMPATIBILITY for Tcl_GetObjType("array search") *** +2019-03-05 (new)[TIP 527] New command [timerate] (sebres) -2016-10-04 Server socket on port 0 chooses port supporting IPv4 * IPv6 (max) +2019-03-08 (bug)[39fed4] [package require] memory validity (hume,porter) -2016-11-25 [array names -regexp] supports backrefs (goth) +2019-04-23 (new) New command tcl::unsupported::corotype (fellows) -2017-01-04 (TIP 456) New routine Tcl_OpenTcpServerEx() (limeboy) +2019-05-04 (bug) memlink when namespace deletion kills linked var (porter) -2017-01-04 (TIP 459) New subcommand [package files] (nijtmans) +2019-05-28 (new) README file converted to README.md in Markdown (nijtmans) -2017-01-16 threaded allocator initialization repair (vasiljevic,nijtmans) +2019-06-17 (bug)[8b9854] [info level 0] regression with ensembles (porter) -2017-01-30 Add to Win shell builtins: assoc ftype move (ashok) +2019-06-20 (bug)[6bdadf] crash multi-arg write-traced [lappend] (fellows,porter) -2017-03-31 TCL_MEM_DEBUG facilities better support 64-bit memory (nijtmans) +2019-06-21 (bug)[f8a33c] crash Tcl_Exit before init (brooks,sebres) -2017-04-13 \u escaped content in msg files converted to true utf-8 (nijtmans) +2019-08-27 (bug)[fa6bf3] Bytecode fails epoch recovery at numLevel=0 (sebres) -2017-05-18 (TIP 458) New epoll or kqueue notifiers are default (alborboz) +2019-08-29 (bug)[fec0c1] C stack overflow compiling bytecode (ade,sebres) -2017-05-31 Purge build support for SunOS-4.* (stu) +2019-09-12 tzdata updated to Olson's tzdata2019c (jima) -2017-06-22 (TIP 463) New option [regsub ... -command ...] (fellows) +2019-09-20 (new) registry/dde no longer need -DUNICODE (nijtmans) +=> registry 1.3.4 +=> dde 1.4.2 -2017-06-22 (TIP 470) Tcl_GetDefineContextObject();[oo::define [self]] (fellows) -=> TclOO 1.2.0 +2019-10-02 (bug)[16768d] Fix [info hostname] on NetBSD (rytaro) -2017-06-23 (TIP 472) Support 0d as prefix of decimal numbers (iyer,griffin) +2019-10-23 (new) libtommath updated to release 1.2.0 (nijtmans) -2017-08-31 (bug)[2a9465] http state 100 continue handling broken (oehlmann) +2019-10-25 OSX: system Tcl deprecated. End default use of its packages. (walzer) -2017-09-02 (bug)[0e4d88] replace command, delete trace kills namespace (porter) +2019-10-28 (bug)[bcd100] bad fs cache when system encoding changes (coulter) ---- Released 8.7a1, September 8, 2017 --- http://core.tcl.tk/tcl/ for details +- Released 8.6.10, November 21, 2019 - details at http://core.tcl-lang.org/tcl/ - -2018-03-12 (TIP 490) add oo support for msgcat => msgcat 1.7.0 (oehlmann) +Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10, +plus the following, which focuses on the high-level feature changes +in this changeset (new minor version) rather than bug fixes: -2018-03-12 (TIP 499) custom locale preference list (oehlmann) -=> msgcat 1.7.0 @@ -8955,7 +9001,10 @@ in this changeset (new minor version) rather than bug fixes: +2018-03-12 (TIP 490) add oo support for msgcat => msgcat 1.7.0 (oehlmann) +2018-03-12 (TIP 499) custom locale preference list (oehlmann) +=> msgcat 1.7.0 -- cgit v0.12 From e85c33074d52d9b69f1c521915615e8660f07d33 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 11 Nov 2019 16:32:42 +0000 Subject: On win32, include if available, just as on UNIX. Disable compiler warning C4244 on all Microsoft compiler versions, not just the latest ones. --- win/tclWinPort.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/win/tclWinPort.h b/win/tclWinPort.h index c30d346..e9ae9dc 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -14,6 +14,7 @@ #ifndef _TCLWINPORT #define _TCLWINPORT + #if !defined(_WIN64) && !defined(__MINGW_USE_VC2005_COMPAT) /* See [Bug 3354324]: file mtime sets wrong time */ # define __MINGW_USE_VC2005_COMPAT @@ -62,6 +63,9 @@ typedef DWORD_PTR * PDWORD_PTR; #include #include #include +#if HAVE_INTTYPES_H +# include +#endif #include #ifndef __GNUC__ @@ -379,12 +383,14 @@ typedef DWORD_PTR * PDWORD_PTR; * including the *printf family and others. Tell it to shut up. * (_MSC_VER is 1200 for VC6, 1300 or 1310 for vc7.net, 1400 for 8.0) */ -#if defined(_MSC_VER) && (_MSC_VER >= 1400) +#if defined(_MSC_VER) # pragma warning(disable:4244) -# pragma warning(disable:4267) -# pragma warning(disable:4311) -# pragma warning(disable:4312) -# pragma warning(disable:4996) +# if _MSC_VER >= 1400 +# pragma warning(disable:4267) +# pragma warning(disable:4311) +# pragma warning(disable:4312) +# pragma warning(disable:4996) +# endif #endif -- cgit v0.12 From de04d595faa9eff7914a831e767b11a2d5116b44 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 13 Nov 2019 08:16:51 +0000 Subject: Fix compiler warning when compiling with -DTCL_UTF_MAX=4 or 6 --- win/tclWinDde.c | 4 ++-- win/tclWinReg.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/win/tclWinDde.c b/win/tclWinDde.c index cbbcdae..267ee6e 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.c @@ -119,8 +119,8 @@ static int DdeObjCmd(void *clientData, #if (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7) # if TCL_UTF_MAX > 3 -# define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf(a,(b)*sizeof(WCHAR),c) -# define Tcl_UtfToWCharDString(a,b,c) Tcl_WinUtfToTChar(a,b,c) +# define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf((TCHAR *)(a),(b)*sizeof(WCHAR),c) +# define Tcl_UtfToWCharDString(a,b,c) (WCHAR *)Tcl_WinUtfToTChar(a,b,c) # else # define Tcl_WCharToUtfDString Tcl_UniCharToUtfDString # define Tcl_UtfToWCharDString Tcl_UtfToUniCharDString diff --git a/win/tclWinReg.c b/win/tclWinReg.c index b66282a..2c1b8a5 100644 --- a/win/tclWinReg.c +++ b/win/tclWinReg.c @@ -126,8 +126,8 @@ static int SetValue(Tcl_Interp *interp, Tcl_Obj *keyNameObj, #if (TCL_MAJOR_VERSION < 9) && (TCL_MINOR_VERSION < 7) # if TCL_UTF_MAX > 3 -# define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf(a,(b)*sizeof(WCHAR),c) -# define Tcl_UtfToWCharDString(a,b,c) Tcl_WinUtfToTChar(a,b,c) +# define Tcl_WCharToUtfDString(a,b,c) Tcl_WinTCharToUtf((TCHAR *)(a),(b)*sizeof(WCHAR),c) +# define Tcl_UtfToWCharDString(a,b,c) (WCHAR *)Tcl_WinUtfToTChar(a,b,c) # else # define Tcl_WCharToUtfDString Tcl_UniCharToUtfDString # define Tcl_UtfToWCharDString Tcl_UtfToUniCharDString -- cgit v0.12 From 3181ee9123bf2402abeba55ca2b9469d74382ed1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 13 Nov 2019 09:07:08 +0000 Subject: Fix TIP #389 implementation, bug [d433c0e0ad]: TCL_UTF_MAX == 4 problems. Thanks to Christian Werner for the report. --- generic/tclEncoding.c | 2 +- generic/tclInt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 002c765..1c1f94c 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -2366,7 +2366,7 @@ UtfToUtfProc( dst += Tcl_UniCharToUtf(*chPtr, dst); #if TCL_UTF_MAX == 4 if ((*chPtr >= 0xD800) && (len < 3)) { - src += TclUtfToUniChar(src + len, chPtr); + src += Tcl_UtfToUniChar(src + len, chPtr); dst += Tcl_UniCharToUtf(*chPtr, dst); } #endif diff --git a/generic/tclInt.h b/generic/tclInt.h index 9038a56..39fb740 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4429,7 +4429,7 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, const char *file, */ #define TclUtfToUniChar(str, chPtr) \ - ((((unsigned char) *(str)) < 0xC0) ? \ + ((((unsigned char) *(str)) < 0x80) ? \ ((*(chPtr) = (unsigned char) *(str)), 1) \ : Tcl_UtfToUniChar(str, chPtr)) -- cgit v0.12 From d3315530e8ae5a6b4dd6fce55c2bea70f4798131 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 13 Nov 2019 12:37:24 +0000 Subject: Part 2 of bugfix [d433c0e0ad]: TCL_UTF_MAX == 4 problems --- generic/tclEncoding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 1c1f94c..f159b32 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -2366,7 +2366,7 @@ UtfToUtfProc( dst += Tcl_UniCharToUtf(*chPtr, dst); #if TCL_UTF_MAX == 4 if ((*chPtr >= 0xD800) && (len < 3)) { - src += Tcl_UtfToUniChar(src + len, chPtr); + src += Tcl_UtfToUniChar(src, chPtr); dst += Tcl_UniCharToUtf(*chPtr, dst); } #endif -- cgit v0.12 From db160493def9e4d6ec6cb55fe788a5784447f1c5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 13 Nov 2019 15:59:11 +0000 Subject: Don't install tommath_class.h and tommath_superclass.h on Windows any more by makefile.vc. Those are purely internal, not needed by extensions. --- win/makefile.vc | 2 -- 1 file changed, 2 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index 01cdb1f..6a428aa 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -893,8 +893,6 @@ install-libraries: tclConfig tcl-nmake install-msgs install-tzdata @$(CPY) "$(GENERICDIR)\tclPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\" @$(CPY) "$(GENERICDIR)\tclTomMath.h" "$(INCLUDE_INSTALL_DIR)\" @$(CPY) "$(GENERICDIR)\tclTomMathDecls.h" "$(INCLUDE_INSTALL_DIR)\" - @$(CPY) "$(TOMMATHDIR)\tommath_class.h" "$(INCLUDE_INSTALL_DIR)\" - @$(CPY) "$(TOMMATHDIR)\tommath_superclass.h" "$(INCLUDE_INSTALL_DIR)\" @echo Installing library files to $(SCRIPT_INSTALL_DIR) @$(CPY) "$(ROOT)\library\history.tcl" "$(SCRIPT_INSTALL_DIR)\" @$(CPY) "$(ROOT)\library\init.tcl" "$(SCRIPT_INSTALL_DIR)\" -- cgit v0.12 From ed907ec2d18048ab42baa3a8a6b4436894dc8912 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 13 Nov 2019 16:01:35 +0000 Subject: Make tclWinFile compile warningless using -DTCL_UTF_MAX=6 (not officially supported, but used by Androwish) --- win/tclWinFile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 20cd6d4..e050862 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -1472,14 +1472,14 @@ TclpGetUserHome( Tcl_DStringFree(&ds); } else { Tcl_DStringInit(&ds); - wName = Tcl_UtfToUniCharDString(domain + 1, -1, &ds); + wName = (WCHAR *)Tcl_WinUtfToTChar(domain + 1, -1, &ds); rc = NetGetDCName(NULL, wName, (LPBYTE *) &wDomain); Tcl_DStringFree(&ds); nameLen = domain - name; } if (rc == 0) { Tcl_DStringInit(&ds); - wName = Tcl_UtfToUniCharDString(name, nameLen, &ds); + wName = (WCHAR *)Tcl_WinUtfToTChar(name, nameLen, &ds); while (NetUserGetInfo(wDomain, wName, 1, (LPBYTE *) &uiPtr) != 0) { /* * User does not exist; if domain was not specified, try again @@ -1507,7 +1507,7 @@ TclpGetUserHome( wHomeDir = uiPtr->usri1_home_dir; if ((wHomeDir != NULL) && (wHomeDir[0] != L'\0')) { size = lstrlenW(wHomeDir); - Tcl_UniCharToUtfDString(wHomeDir, size, bufferPtr); + Tcl_WinTCharToUtf((TCHAR *)wHomeDir, size*sizeof(WCHAR), bufferPtr); } else { /* * User exists but has no home dir. Return @@ -1515,7 +1515,7 @@ TclpGetUserHome( */ GetProfilesDirectoryW(buf, &size); - Tcl_UniCharToUtfDString(buf, size-1, bufferPtr); + Tcl_WinTCharToUtf((TCHAR *)buf, (size-1)*sizeof(WCHAR), bufferPtr); Tcl_DStringAppend(bufferPtr, "/", 1); Tcl_DStringAppend(bufferPtr, name, nameLen); } -- cgit v0.12 From 21c4caf8e19c2d81a598a7973022966f42cb3455 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 13 Nov 2019 17:32:26 +0000 Subject: More work on changes. --- changes | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/changes b/changes index 1bbcf91..b2bffcd 100644 --- a/changes +++ b/changes @@ -8988,29 +8988,66 @@ in this changeset (new minor version) rather than bug fixes: 2019-10-28 (bug)[bcd100] bad fs cache when system encoding changes (coulter) -- Released 8.6.10, November 21, 2019 - details at http://core.tcl-lang.org/tcl/ - +- Released 8.6.10, Nov 21, 2019 - details at http://core.tcl-lang.org/tcl/ - Changes to 8.7a3 include all changes to the 8.6 line through 8.6.10, plus the following, which focuses on the high-level feature changes in this changeset (new minor version) rather than bug fixes: +2017-11-01 (bug)[3c32a3] crash deleting class mixed into instance (coulter) +2017-11-03 (new)[TIP 345] eliminate the encoding 'identity' (porter) +2017-11-04 (bug)[0d902e] [string first] on ASCII stored as Unicode (fellows) +2017-11-17 (new)[TIP 422] Mark all Tcl_*VA() routines deprecated. (nijtmans) +2017-11-20 (support) Ended use of the obsolete values.h header (culler) +2017-11-30 (bug)[8e1e31] [lsort] ordering of U+0000 (nijtmans) +2017-12-07 (new)[TIP 487] Terminate support for pre-XP Windows (nijtmans) -2018-03-12 (TIP 490) add oo support for msgcat => msgcat 1.7.0 (oehlmann) +2017-12-08 (new)[TIP 477] Reform of nmake build (nadkarni) -2018-03-12 (TIP 499) custom locale preference list (oehlmann) +2017-12-20 (bug)[ba1419] Crash: complex ensemble delete, namespace-7.8 (coulter) + +2018-01-17 (new)[TIP 485] Removal of many deprecated features (nijtmans) + +2018-01-27 (bug) Crash in [join $l $l], join-4.1 (porter) + +2018-02-06 (new)[TIP 493] Cease Distribution of http 1.0 (porter) + +2018-02-06 (new)[TIP 484] internal rep for native ints are all 64-bit (nijtmans) + +2018-02-14 (new)[TIP 476] Scan/Printf consistency (nijtmans) + +2018-03-05 (new)[TIP 351] [lsearch] striding + +2018-03-05 (new)[TIPs 330,336] tighten access to Interp fields (porter) + +2018-03-12 (new)[TIP 462] [::tcl::process] + +2018-03-12 (new)[TIP 490] add oo support for msgcat => msgcat 1.7.0 (oehlmann) + +2018-03-12 (new)[TIP 499] custom locale preference list (oehlmann) => msgcat 1.7.0 +2018-03-20 (new)[TIP 503] End CONST84 support for Tcl 8.3 (porter) + +2018-03-30 Refactored [lrange] (spjuth) + +2018-04-20 (new)[TIP 389] Unicode beyond BMP (nijtmans) +2018-04-20 (new)[TIP 421] [array for] +2018-05-11 (new)[TIP 425] Windows panic callback use of UTF-8 +2018-05-17 (new)[TIP 491] Phase out --disable-threads support +2018-06-03 (new)[TIP 500] TclOO Private Methods and Variables +2018-07-26 (bug)[ba921a] [string cat] of bytearrays (coulter,porter) -- cgit v0.12 From 37076881576fb0897e3c1c257ca37cd87685da0c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 14 Nov 2019 14:01:13 +0000 Subject: Better - more complete - fix for [d433c0e0ad]: TCL_UTF_MAX == 4 problems. It allows emoji to be produced by the system encoding, even for other values of TCL_UTF_MAX. Also added test-cases for this. --- generic/tclEncoding.c | 37 +++++++++++++++++++++++++------------ tests/encoding.test | 16 ++++++++++++++++ 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index f159b32..00b97f5 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -2155,7 +2155,7 @@ BinaryProc( /* *------------------------------------------------------------------------- * - * UtfExtToUtfIntProc -- + * UtfIntToUtfExtProc -- * * Convert from UTF-8 to UTF-8. While converting null-bytes from the * Tcl's internal representation (0xc0, 0x80) to the official @@ -2296,7 +2296,7 @@ UtfToUtfProc( * output buffer. */ int pureNullMode) /* Convert embedded nulls from internal * representation to real null-bytes or vice - * versa. */ + * versa. Also combine or separate surrogate pairs */ { const char *srcStart, *srcEnd, *srcClose; const char *dstStart, *dstEnd; @@ -2312,14 +2312,14 @@ UtfToUtfProc( srcEnd = src + srcLen; srcClose = srcEnd; if ((flags & TCL_ENCODING_END) == 0) { - srcClose -= TCL_UTF_MAX; + srcClose -= 6; } if (flags & TCL_ENCODING_CHAR_LIMIT) { charLimit = *dstCharsPtr; } dstStart = dst; - dstEnd = dst + dstLen - TCL_UTF_MAX; + dstEnd = dst + dstLen - ((pureNullMode == 1) ? 4 : TCL_UTF_MAX); for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) { if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) { @@ -2361,15 +2361,28 @@ UtfToUtfProc( src += 1; dst += Tcl_UniCharToUtf(*chPtr, dst); } else { - int len = TclUtfToUniChar(src, chPtr); - src += len; - dst += Tcl_UniCharToUtf(*chPtr, dst); -#if TCL_UTF_MAX == 4 - if ((*chPtr >= 0xD800) && (len < 3)) { - src += Tcl_UtfToUniChar(src, chPtr); - dst += Tcl_UniCharToUtf(*chPtr, dst); + src += TclUtfToUniChar(src, chPtr); + if ((*chPtr & 0xFC00) == 0xD800) { + /* A high surrogate character is detected, handle especially */ + Tcl_UniChar low = *chPtr; + size_t len = Tcl_UtfToUniChar(src, &low); + if ((low & 0xFC00) != 0xDC00) { + *dst++ = (char) (((*chPtr >> 12) | 0xE0) & 0xEF); + *dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF); + *dst++ = (char) ((*chPtr | 0x80) & 0xBF); + continue; + } else if (pureNullMode == 1) { + int full = (((*chPtr & 0x3FF) << 10) | (low & 0x3FF)) + 0x10000; + *dst++ = (char) (((full >> 18) | 0xF0) & 0xF7); + *dst++ = (char) (((full >> 12) | 0x80) & 0xBF); + *dst++ = (char) (((full >> 6) | 0x80) & 0xBF); + *dst++ = (char) ((full | 0x80) & 0xBF); + *chPtr = 0; + src += len; + continue; + } } -#endif + dst += Tcl_UniCharToUtf(*chPtr, dst); } } diff --git a/tests/encoding.test b/tests/encoding.test index ed0e6a4..cf27190 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -328,6 +328,22 @@ test encoding-15.3 {UtfToUtfProc null character input} { binary scan [encoding convertto identity $y] H* z list [string bytelength $x] [string bytelength $y] $z } {1 2 c080} +test encoding-15.4 {UtfToUtfProc emoji character input} { + set x \xED\xA0\xBD\xED\xB8\x82 + set y [encoding convertfrom utf-8 \xED\xA0\xBD\xED\xB8\x82] + list [string length $x] [string length $y] $y +} "6 2 \uD83D\uDE02" +test encoding-15.5 {UtfToUtfProc emoji character input} { + set x \xF0\x9F\x98\x82 + set y [encoding convertfrom utf-8 \xF0\x9F\x98\x82] + list [string length $x] [string length $y] $y +} "4 2 \uD83D\uDE02" +test encoding-15.6 {UtfToUtfProc emoji character output} { + set x \uD83D\uDE02 + set y [encoding convertto utf-8 \uD83D\uDE02] + binary scan $y H* z + list [string length $x] [string length $y] $z +} {2 4 f09f9882} test encoding-16.1 {UnicodeToUtfProc} { set val [encoding convertfrom unicode NN] -- cgit v0.12 From f00d9f9d02d293675899b1c0ce23aa5cb641cd92 Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 14 Nov 2019 17:04:39 +0000 Subject: bug [135804138e]: test case illustrating the segfault --- tests/oo.test | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/oo.test b/tests/oo.test index b0704da..55018e9 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -1353,6 +1353,35 @@ test oo-7.9 {OO: defining inheritance in namespaces} -setup { return } } -result {} +test oo-7.10 {OO: next after object deletion, bug [135804138e]} -setup { + set ::result "" + oo::class create c1 { + method m1 {} { + lappend ::result c1::m1 + } + } + oo::class create c2 { + superclass c1 + destructor { + lappend ::result c2::destructor + my m1 + lappend ::result /c2::destructor + } + method m1 {} { + lappend ::result delete + rename [self] {} + lappend ::result no-self + next + lappend ::result unreachable + } + } +} -body { + c2 create o + lappend ::result [catch {o m1} msg] $msg +} -cleanup { + c1 destroy + unset ::result +} -result {delete c2::destructor delete no-self c1::m1 unreachable /c2::destructor no-self 1 {no next method implementation}} test oo-8.1 {OO: global must work in methods} { oo::object create foo -- cgit v0.12 From b098fb32795b2f8e09c277d0d306986a6f5a9c7e Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 14 Nov 2019 17:06:06 +0000 Subject: fixed SF [135804138e] -- no call of next possible after object namespace is deleted --- generic/tclOOMethod.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 3e64ba2..fbd23c0 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -671,11 +671,11 @@ InvokeProcedureMethod( * call frame's lifetime). */ /* - * If the interpreter was deleted, we just skip to the next thing in the - * chain. + * If the object namespace (or interpreter) were deleted, we just skip to + * the next thing in the chain. */ - if (Tcl_InterpDeleted(interp)) { + if (!((CallContext *)context)->oPtr->namespacePtr) { return TclNRObjectContextInvokeNext(interp, context, objc, objv, Tcl_ObjectContextSkippedArgs(context)); } -- cgit v0.12 From 05b4cb2080209949f44fdf00e08a044584bffe73 Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 14 Nov 2019 17:41:51 +0000 Subject: make oo-7.10 test more readable --- tests/oo.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/oo.test b/tests/oo.test index 55018e9..77fca68 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -1368,11 +1368,11 @@ test oo-7.10 {OO: next after object deletion, bug [135804138e]} -setup { lappend ::result /c2::destructor } method m1 {} { - lappend ::result delete + lappend ::result c2::m1 rename [self] {} lappend ::result no-self next - lappend ::result unreachable + lappend ::result /c2::m1 } } } -body { @@ -1381,7 +1381,7 @@ test oo-7.10 {OO: next after object deletion, bug [135804138e]} -setup { } -cleanup { c1 destroy unset ::result -} -result {delete c2::destructor delete no-self c1::m1 unreachable /c2::destructor no-self 1 {no next method implementation}} +} -result {c2::m1 c2::destructor c2::m1 no-self c1::m1 /c2::m1 /c2::destructor no-self 1 {no next method implementation}} test oo-8.1 {OO: global must work in methods} { oo::object create foo -- cgit v0.12 From 434361c3c66494a5fb28d24bdf591b9ac803673c Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 14 Nov 2019 19:22:46 +0000 Subject: restore verification for deleted interp --- generic/tclOOMethod.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index fbd23c0..0c5f4bb 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -675,7 +675,9 @@ InvokeProcedureMethod( * the next thing in the chain. */ - if (!((CallContext *)context)->oPtr->namespacePtr) { + if (!((CallContext *)context)->oPtr->namespacePtr || + Tcl_InterpDeleted(interp) + ) { return TclNRObjectContextInvokeNext(interp, context, objc, objv, Tcl_ObjectContextSkippedArgs(context)); } -- cgit v0.12 From bb1eeada78e64c97e89d7bddf99cb8dcfe845d8c Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 14 Nov 2019 19:57:12 +0000 Subject: remove unneeded constraint --- tests/io.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/io.test b/tests/io.test index 4257d51..04fa1d2 100644 --- a/tests/io.test +++ b/tests/io.test @@ -7347,7 +7347,7 @@ test io-53.3 {CopyData: background read underflow} {stdio unix openpipe fcopy} { close $f set result } "ready line1 line2 {done\n}" -test io-53.4 {CopyData: background write overflow} {stdio unix openpipe fileevent fcopy} { +test io-53.4 {CopyData: background write overflow} {stdio openpipe fileevent fcopy} { set big bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n variable x for {set x 0} {$x < 12} {incr x} { -- cgit v0.12 From e00ef49560bb5bd4349d017887c7cd5a2d0ba38e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 15 Nov 2019 09:41:03 +0000 Subject: Protect additional Tcl_UtfToUniChar() call, for the case when not enough bytes are available in the buffer any more. Add additional test-cases for those situations (upper surrogate followed by somthing other than lower surrogate) --- generic/tclEncoding.c | 2 +- tests/encoding.test | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 00b97f5..9e1d262 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -2365,7 +2365,7 @@ UtfToUtfProc( if ((*chPtr & 0xFC00) == 0xD800) { /* A high surrogate character is detected, handle especially */ Tcl_UniChar low = *chPtr; - size_t len = Tcl_UtfToUniChar(src, &low); + size_t len = (src <= srcEnd-3) ? Tcl_UtfToUniChar(src, &low) : 0; if ((low & 0xFC00) != 0xDC00) { *dst++ = (char) (((*chPtr >> 12) | 0xE0) & 0xEF); *dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF); diff --git a/tests/encoding.test b/tests/encoding.test index cf27190..36fcff6 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -339,11 +339,29 @@ test encoding-15.5 {UtfToUtfProc emoji character input} { list [string length $x] [string length $y] $y } "4 2 \uD83D\uDE02" test encoding-15.6 {UtfToUtfProc emoji character output} { - set x \uD83D\uDE02 - set y [encoding convertto utf-8 \uD83D\uDE02] + set x \uDE02\uD83D\uDE02\uD83D + set y [encoding convertto utf-8 \uDE02\uD83D\uDE02\uD83D] binary scan $y H* z list [string length $x] [string length $y] $z -} {2 4 f09f9882} +} {4 10 edb882f09f9882eda0bd} +test encoding-15.7 {UtfToUtfProc emoji character output} { + set x \uDE02\uD83D\uD83D + set y [encoding convertto utf-8 \uDE02\uD83D\uD83D] + binary scan $y H* z + list [string length $x] [string length $y] $z +} {3 9 edb882eda0bdeda0bd} +test encoding-15.8 {UtfToUtfProc emoji character output} { + set x \uDE02\uD83D\xE9 + set y [encoding convertto utf-8 \uDE02\uD83D\xE9] + binary scan $y H* z + list [string length $x] [string length $y] $z +} {3 8 edb882eda0bdc3a9} +test encoding-15.9 {UtfToUtfProc emoji character output} { + set x \uDE02\uD83DX + set y [encoding convertto utf-8 \uDE02\uD83DX] + binary scan $y H* z + list [string length $x] [string length $y] $z +} {3 7 edb882eda0bd58} test encoding-16.1 {UnicodeToUtfProc} { set val [encoding convertfrom unicode NN] -- cgit v0.12 From b99314020d3b01f6b4616e7d1f36a9d120b0d7ec Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 15 Nov 2019 12:54:12 +0000 Subject: Remove mp_get_bit() from the libtommath stub table: It wasn't present in Tcl 8.6.9, isn't used anywhere in Tcl, and is going to be deprecated in libtommath. --- generic/tclStubInit.c | 2 +- generic/tclTomMath.decls | 3 --- generic/tclTomMathDecls.h | 10 +++------- unix/Makefile.in | 17 +++++++---------- win/Makefile.in | 1 - win/makefile.vc | 1 - 6 files changed, 11 insertions(+), 23 deletions(-) diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index 09c975d..631a417 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -925,7 +925,7 @@ const TclTomMathStubs tclTomMathStubs = { TclBN_mp_tc_or, /* 74 */ TclBN_mp_tc_xor, /* 75 */ TclBN_mp_signed_rsh, /* 76 */ - TclBN_mp_get_bit, /* 77 */ + 0, /* 77 */ TclBN_mp_to_ubin, /* 78 */ 0, /* 79 */ TclBN_mp_to_radix, /* 80 */ diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls index c5645a4..40b182f 100644 --- a/generic/tclTomMath.decls +++ b/generic/tclTomMath.decls @@ -254,9 +254,6 @@ declare 75 { declare 76 { mp_err TclBN_mp_signed_rsh(const mp_int *a, int b, mp_int *c) } -declare 77 { - mp_bool TclBN_mp_get_bit(const mp_int *a, unsigned int b) -} # Added in libtommath 1.2.0 declare 78 { diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h index a1da2c9..3436798 100644 --- a/generic/tclTomMathDecls.h +++ b/generic/tclTomMathDecls.h @@ -72,7 +72,6 @@ #define mp_expt_d TclBN_mp_expt_d #define mp_expt_d_ex TclBN_mp_expt_d_ex #define mp_expt_u32 TclBN_mp_expt_d -#define mp_get_bit TclBN_mp_get_bit #define mp_grow TclBN_mp_grow #define mp_init TclBN_mp_init #define mp_init_copy TclBN_mp_init_copy @@ -119,7 +118,6 @@ #define mp_zero TclBN_mp_zero #define s_mp_add TclBN_s_mp_add #define s_mp_balance_mul TclBN_mp_balance_mul -#define s_mp_get_bit TclBN_mp_get_bit #define s_mp_karatsuba_mul TclBN_mp_karatsuba_mul #define s_mp_karatsuba_sqr TclBN_mp_karatsuba_sqr #define s_mp_mul_digs TclBN_s_mp_mul_digs @@ -341,8 +339,7 @@ EXTERN mp_err TclBN_mp_tc_xor(const mp_int *a, const mp_int *b, /* 76 */ EXTERN mp_err TclBN_mp_signed_rsh(const mp_int *a, int b, mp_int *c); -/* 77 */ -EXTERN mp_bool TclBN_mp_get_bit(const mp_int *a, unsigned int b); +/* Slot 77 is reserved */ /* 78 */ EXTERN int TclBN_mp_to_ubin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written); @@ -432,7 +429,7 @@ typedef struct TclTomMathStubs { mp_err (*tclBN_mp_tc_or) (const mp_int *a, const mp_int *b, mp_int *c); /* 74 */ mp_err (*tclBN_mp_tc_xor) (const mp_int *a, const mp_int *b, mp_int *c); /* 75 */ mp_err (*tclBN_mp_signed_rsh) (const mp_int *a, int b, mp_int *c); /* 76 */ - mp_bool (*tclBN_mp_get_bit) (const mp_int *a, unsigned int b); /* 77 */ + void (*reserved77)(void); int (*tclBN_mp_to_ubin) (const mp_int *a, unsigned char *buf, size_t maxlen, size_t *written); /* 78 */ void (*reserved79)(void); int (*tclBN_mp_to_radix) (const mp_int *a, char *str, size_t maxlen, size_t *written, int radix); /* 80 */ @@ -600,8 +597,7 @@ extern const TclTomMathStubs *tclTomMathStubsPtr; (tclTomMathStubsPtr->tclBN_mp_tc_xor) /* 75 */ #define TclBN_mp_signed_rsh \ (tclTomMathStubsPtr->tclBN_mp_signed_rsh) /* 76 */ -#define TclBN_mp_get_bit \ - (tclTomMathStubsPtr->tclBN_mp_get_bit) /* 77 */ +/* Slot 77 is reserved */ #define TclBN_mp_to_ubin \ (tclTomMathStubsPtr->tclBN_mp_to_ubin) /* 78 */ /* Slot 79 is reserved */ diff --git a/unix/Makefile.in b/unix/Makefile.in index 321b0e2..af9e090 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -319,26 +319,26 @@ OO_OBJS = tclOO.o tclOOBasic.o tclOOCall.o tclOODefineCmds.o tclOOInfo.o \ TOMMATH_OBJS = bn_s_mp_reverse.o bn_s_mp_mul_digs_fast.o \ bn_s_mp_sqr_fast.o bn_mp_add.o bn_mp_and.o \ - bn_mp_add_d.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o \ - bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o \ + bn_mp_add_d.o bn_mp_clamp.o bn_mp_clear.o bn_mp_clear_multi.o \ + bn_mp_cmp.o bn_mp_cmp_d.o bn_mp_cmp_mag.o \ bn_mp_cnt_lsb.o bn_mp_copy.o \ bn_mp_count_bits.o bn_mp_div.o bn_mp_div_d.o bn_mp_div_2.o \ bn_mp_div_2d.o bn_mp_div_3.o bn_mp_exch.o bn_mp_expt_u32.o \ - bn_s_mp_get_bit.o bn_mp_grow.o bn_mp_init.o \ + bn_mp_grow.o bn_mp_init.o \ bn_mp_init_copy.o bn_mp_init_multi.o bn_mp_init_set.o \ bn_mp_init_size.o bn_s_mp_karatsuba_mul.o \ bn_s_mp_karatsuba_sqr.o bn_s_mp_balance_mul.o \ - bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mul.o bn_mp_mul_2.o \ - bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_neg.o bn_mp_or.o \ + bn_mp_lshd.o bn_mp_mod.o bn_mp_mod_2d.o bn_mp_mul.o bn_mp_mul_2.o \ + bn_mp_mul_2d.o bn_mp_mul_d.o bn_mp_neg.o bn_mp_or.o \ bn_mp_radix_size.o bn_mp_radix_smap.o \ - bn_mp_read_radix.o bn_mp_rshd.o bn_mp_set.o \ + bn_mp_read_radix.o bn_mp_rshd.o bn_mp_set.o \ bn_mp_shrink.o \ bn_mp_sqr.o bn_mp_sqrt.o bn_mp_sub.o bn_mp_sub_d.o \ bn_mp_signed_rsh.o \ bn_mp_to_ubin.o \ bn_s_mp_toom_mul.o bn_s_mp_toom_sqr.o bn_mp_to_radix.o \ bn_mp_ubin_size.o bn_mp_xor.o bn_mp_zero.o bn_s_mp_add.o \ - bn_s_mp_mul_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o + bn_s_mp_mul_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o STUB_LIB_OBJS = tclStubLib.o \ tclTomMathStubLib.o \ @@ -1515,9 +1515,6 @@ bn_mp_exch.o: $(TOMMATH_DIR)/bn_mp_exch.c $(MATHHDRS) bn_mp_expt_u32.o: $(TOMMATH_DIR)/bn_mp_expt_u32.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_expt_u32.c -bn_s_mp_get_bit.o: $(TOMMATH_DIR)/bn_s_mp_get_bit.c $(MATHHDRS) - $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_s_mp_get_bit.c - bn_mp_grow.o: $(TOMMATH_DIR)/bn_mp_grow.c $(MATHHDRS) $(CC) -c $(CC_SWITCHES) $(TOMMATH_DIR)/bn_mp_grow.c diff --git a/win/Makefile.in b/win/Makefile.in index 5e3252e..d7b4142 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -364,7 +364,6 @@ TOMMATH_OBJS = \ bn_mp_zero.${OBJEXT} \ bn_s_mp_add.${OBJEXT} \ bn_s_mp_balance_mul.$(OBJEXT) \ - bn_s_mp_get_bit.${OBJEXT} \ bn_s_mp_karatsuba_mul.${OBJEXT} \ bn_s_mp_karatsuba_sqr.$(OBJEXT) \ bn_s_mp_mul_digs.${OBJEXT} \ diff --git a/win/makefile.vc b/win/makefile.vc index 6a428aa..9b36abf 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -367,7 +367,6 @@ TOMMATHOBJS = \ $(TMP_DIR)\bn_mp_zero.obj \ $(TMP_DIR)\bn_s_mp_add.obj \ $(TMP_DIR)\bn_s_mp_balance_mul.obj \ - $(TMP_DIR)\bn_s_mp_get_bit.obj \ $(TMP_DIR)\bn_s_mp_karatsuba_mul.obj \ $(TMP_DIR)\bn_s_mp_karatsuba_sqr.obj \ $(TMP_DIR)\bn_s_mp_mul_digs.obj \ -- cgit v0.12 From e404d079599169631976ea93a1844a2187adce25 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Fri, 15 Nov 2019 13:50:39 +0000 Subject: Add TclOOObjectDestroyed to make logic more explicit. Renamed Deleted() to Destructing(). No functiontional changes. --- generic/tclOO.c | 44 +++++++++++++++++++++++++++++--------------- generic/tclOOInt.h | 14 ++++++-------- generic/tclOOMethod.c | 2 +- 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index 1c2277e..c9ef94f 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -226,7 +226,7 @@ MODULE_SCOPE const TclOOStubs tclOOStubs; * ROOT_CLASS respectively. */ -#define Deleted(oPtr) ((oPtr)->flags & OBJECT_DELETED) +#define Destructing(oPtr) ((oPtr)->flags & OBJECT_DESTRUCTING) #define IsRootObject(ocPtr) ((ocPtr)->flags & ROOT_OBJECT) #define IsRootClass(ocPtr) ((ocPtr)->flags & ROOT_CLASS) #define IsRoot(ocPtr) ((ocPtr)->flags & (ROOT_OBJECT|ROOT_CLASS)) @@ -839,7 +839,7 @@ ObjectRenamedTrace( * 2950259]. */ - if (!Deleted(oPtr)) { + if (!Destructing(oPtr)) { Tcl_DeleteNamespace(oPtr->namespacePtr); } oPtr->command = NULL; @@ -879,7 +879,7 @@ TclOODeleteDescendants( * clsPtr */ - if (!Deleted(mixinSubclassPtr->thisPtr) + if (!Destructing(mixinSubclassPtr->thisPtr) && !(mixinSubclassPtr->thisPtr->flags & DONT_DELETE)) { Tcl_DeleteCommandFromToken(interp, mixinSubclassPtr->thisPtr->command); @@ -898,7 +898,7 @@ TclOODeleteDescendants( if (clsPtr->subclasses.num > 0) { while (clsPtr->subclasses.num > 0) { subclassPtr = clsPtr->subclasses.list[clsPtr->subclasses.num - 1]; - if (!Deleted(subclassPtr->thisPtr) && !IsRoot(subclassPtr) + if (!Destructing(subclassPtr->thisPtr) && !IsRoot(subclassPtr) && !(subclassPtr->thisPtr->flags & DONT_DELETE)) { Tcl_DeleteCommandFromToken(interp, subclassPtr->thisPtr->command); @@ -924,7 +924,7 @@ TclOODeleteDescendants( * This condition also covers the case where instancePtr == oPtr */ - if (!Deleted(instancePtr) && !IsRoot(instancePtr) && + if (!Destructing(instancePtr) && !IsRoot(instancePtr) && !(instancePtr->flags & DONT_DELETE)) { Tcl_DeleteCommandFromToken(interp, instancePtr->command); } @@ -965,7 +965,7 @@ TclOOReleaseClassContents( * Sanity check! */ - if (!Deleted(oPtr)) { + if (!Destructing(oPtr)) { if (IsRootClass(oPtr)) { Tcl_Panic("deleting class structure for non-deleted %s", "::oo::class"); @@ -1063,7 +1063,7 @@ TclOOReleaseClassContents( ckfree(clsPtr->variables.list); } - if (IsRootClass(oPtr) && !Deleted(fPtr->objectCls->thisPtr)) { + if (IsRootClass(oPtr) && !Destructing(fPtr->objectCls->thisPtr)) { Tcl_DeleteCommandFromToken(interp, fPtr->objectCls->thisPtr->command); } } @@ -1095,7 +1095,7 @@ ObjectNamespaceDeleted( Tcl_Interp *interp = oPtr->fPtr->interp; int i; - if (Deleted(oPtr)) { + if (Destructing(oPtr)) { /* * TODO: Can ObjectNamespaceDeleted ever be called twice? If not, * this guard could be removed. @@ -1108,7 +1108,7 @@ ObjectNamespaceDeleted( * process of being deleted, nothing else may modify its bookeeping * records. This is the flag that */ - oPtr->flags |= OBJECT_DELETED; + oPtr->flags |= OBJECT_DESTRUCTING; /* * Let the dominoes fall! @@ -1242,7 +1242,7 @@ ObjectNamespaceDeleted( * sometimes not go away automatically; we force it here. [Bug 2962664] */ - if (IsRootObject(oPtr) && !Deleted(fPtr->classCls->thisPtr) + if (IsRootObject(oPtr) && !Destructing(fPtr->classCls->thisPtr) && !Tcl_InterpDeleted(interp)) { Tcl_DeleteCommandFromToken(interp, fPtr->classCls->thisPtr->command); @@ -1287,6 +1287,20 @@ int TclOODecrRefCount(Object *oPtr) { } /* + * ---------------------------------------------------------------------- + * + * TclOOObjectDestroyed -- + * + * Returns TCL_OK if an object is entirely deleted, i.e. the destruction + * sequence has completed. + * + * ---------------------------------------------------------------------- + */ +int TclOOObjectDestroyed(Object *oPtr) { + oPtr->namespacePtr == NULL; +} + +/* * Setting the "empty" location to NULL makes debugging a little easier. */ @@ -1446,7 +1460,7 @@ TclOOAddToSubclasses( * is assumed that the class is not already * present as a subclass in the superclass. */ { - if (Deleted(superPtr->thisPtr)) { + if (Destructing(superPtr->thisPtr)) { return; } if (superPtr->subclasses.num >= superPtr->subclasses.size) { @@ -1511,7 +1525,7 @@ TclOOAddToMixinSubs( * is assumed that the class is not already * present as a subclass in the superclass. */ { - if (Deleted(superPtr->thisPtr)) { + if (Destructing(superPtr->thisPtr)) { return; } if (superPtr->mixinSubs.num >= superPtr->mixinSubs.size) { @@ -1809,7 +1823,7 @@ FinalizeAlloc( * Don't want to lose errors by accident. [Bug 2903011] */ - if (result != TCL_ERROR && Deleted(oPtr)) { + if (result != TCL_ERROR && Destructing(oPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "object deleted in constructor", -1)); Tcl_SetErrorCode(interp, "TCL", "OO", "STILLBORN", NULL); @@ -1824,7 +1838,7 @@ FinalizeAlloc( * command before we delete it. [Bug 9dd1bd7a74] */ - if (!Deleted(oPtr)) { + if (!Destructing(oPtr)) { (void) TclOOObjectName(interp, oPtr); Tcl_DeleteCommandFromToken(interp, oPtr->command); } @@ -1961,7 +1975,7 @@ Tcl_CopyObjectInstance( */ o2Ptr->flags = oPtr->flags & ~( - OBJECT_DELETED | ROOT_OBJECT | ROOT_CLASS | FILTER_HANDLING); + OBJECT_DESTRUCTING | ROOT_OBJECT | ROOT_CLASS | FILTER_HANDLING); /* * Copy the object's metadata. diff --git a/generic/tclOOInt.h b/generic/tclOOInt.h index 436acd6..0e4503a 100644 --- a/generic/tclOOInt.h +++ b/generic/tclOOInt.h @@ -189,14 +189,11 @@ typedef struct Object { LIST_STATIC(Tcl_Obj *) variables; } Object; -#define OBJECT_DELETED 1 /* Flag to say that an object has been - * destroyed. */ -#define DESTRUCTOR_CALLED 2 /* Flag to say that the destructor has been - * called. */ -#define CLASS_GONE 4 /* Obsolete. Indicates that the class of this - * object has been deleted, and so the object - * should not attempt to remove itself from its - * class. */ +#define OBJECT_DESTRUCTING 1 /* Indicates that an object is being or has + * been destroyed */ +#define DESTRUCTOR_CALLED 2 /* Indicates that evaluation of destructor script for the + object has began */ +#define OO_UNUSED_4 4 /* No longer used. */ #define ROOT_OBJECT 0x1000 /* Flag to say that this object is the root of * the class hierarchy and should be treated * specially during teardown. */ @@ -497,6 +494,7 @@ MODULE_SCOPE Object * TclNewObjectInstanceCommon(Tcl_Interp *interp, const char *nameStr, const char *nsNameStr); MODULE_SCOPE int TclOODecrRefCount(Object *oPtr); +MODULE_SCOPE int TclOOObjectDestroyed(Object *oPtr); MODULE_SCOPE int TclOODefineSlots(Foundation *fPtr); MODULE_SCOPE void TclOODeleteChain(CallChain *callPtr); MODULE_SCOPE void TclOODeleteChainCache(Tcl_HashTable *tablePtr); diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 0c5f4bb..6f2612c 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -675,7 +675,7 @@ InvokeProcedureMethod( * the next thing in the chain. */ - if (!((CallContext *)context)->oPtr->namespacePtr || + if (!TclOOObjectDestroyed(((CallContext *)context)->oPtr) || Tcl_InterpDeleted(interp) ) { return TclNRObjectContextInvokeNext(interp, context, objc, objv, -- cgit v0.12 From 521b33f6ec17381c19722e73043934c1dc81bea4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 15 Nov 2019 14:35:12 +0000 Subject: Backout [b5c1404365f53fe0], removing TclFreeObj() is a step too far for 8.7 --- generic/tcl.decls | 3 +-- generic/tcl.h | 11 ++--------- generic/tclDecls.h | 8 ++++---- generic/tclInt.h | 1 - generic/tclStubInit.c | 4 +--- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/generic/tcl.decls b/generic/tcl.decls index 910c29e..8555ac2 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -132,9 +132,8 @@ declare 28 { declare 29 { Tcl_Obj *Tcl_DuplicateObj(Tcl_Obj *objPtr) } -# Only available as stub-entry, for backwards-compatible stub-enabled extensions declare 30 { - void TclOldFreeObj(Tcl_Obj *objPtr) + void TclFreeObj(Tcl_Obj *objPtr) } declare 31 { int Tcl_GetBoolean(Tcl_Interp *interp, const char *src, int *boolPtr) diff --git a/generic/tcl.h b/generic/tcl.h index c1187c6..5fb91f2 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -2452,14 +2452,7 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv); # undef Tcl_IsShared # define Tcl_IsShared(objPtr) \ Tcl_DbIsShared(objPtr, __FILE__, __LINE__) -#elif (!defined(TCL_NO_DEPRECATED) && defined(USE_TCL_STUBS)) -/* - * When compiling stub-enabled extensions without -DTCL_NO_DEPRECATED, - * those extensions are expected to run fine with Tcl 8.6 as well. - * This means we must continue to use macro's for the above 3 functions, - * and the old stub entry for TclFreeObj. All other usage of TclFreeObj() - * is forbidden now, therefore it is changed to be MODULE_SCOPE internal. - */ +#else # undef Tcl_IncrRefCount # define Tcl_IncrRefCount(objPtr) \ ++(objPtr)->refCount @@ -2472,7 +2465,7 @@ EXTERN int TclZipfs_AppHook(int *argc, char ***argv); do { \ Tcl_Obj *_objPtr = (objPtr); \ if ((_objPtr)->refCount-- <= 1) { \ - TclOldFreeObj(_objPtr); \ + TclFreeObj(_objPtr); \ } \ } while(0) # undef Tcl_IsShared diff --git a/generic/tclDecls.h b/generic/tclDecls.h index b37491a..4f2d63f 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -143,7 +143,7 @@ EXTERN Tcl_Obj * Tcl_DbNewStringObj(const char *bytes, int length, /* 29 */ EXTERN Tcl_Obj * Tcl_DuplicateObj(Tcl_Obj *objPtr); /* 30 */ -EXTERN void TclOldFreeObj(Tcl_Obj *objPtr); +EXTERN void TclFreeObj(Tcl_Obj *objPtr); /* 31 */ EXTERN int Tcl_GetBoolean(Tcl_Interp *interp, const char *src, int *boolPtr); @@ -1970,7 +1970,7 @@ typedef struct TclStubs { Tcl_Obj * (*tcl_DbNewObj) (const char *file, int line); /* 27 */ Tcl_Obj * (*tcl_DbNewStringObj) (const char *bytes, int length, const char *file, int line); /* 28 */ Tcl_Obj * (*tcl_DuplicateObj) (Tcl_Obj *objPtr); /* 29 */ - void (*tclOldFreeObj) (Tcl_Obj *objPtr); /* 30 */ + void (*tclFreeObj) (Tcl_Obj *objPtr); /* 30 */ int (*tcl_GetBoolean) (Tcl_Interp *interp, const char *src, int *boolPtr); /* 31 */ int (*tcl_GetBooleanFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *boolPtr); /* 32 */ unsigned char * (*tcl_GetByteArrayFromObj) (Tcl_Obj *objPtr, int *lengthPtr); /* 33 */ @@ -2683,8 +2683,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_DbNewStringObj) /* 28 */ #define Tcl_DuplicateObj \ (tclStubsPtr->tcl_DuplicateObj) /* 29 */ -#define TclOldFreeObj \ - (tclStubsPtr->tclOldFreeObj) /* 30 */ +#define TclFreeObj \ + (tclStubsPtr->tclFreeObj) /* 30 */ #define Tcl_GetBoolean \ (tclStubsPtr->tcl_GetBoolean) /* 31 */ #define Tcl_GetBooleanFromObj \ diff --git a/generic/tclInt.h b/generic/tclInt.h index 790eba1..681cb61 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4130,7 +4130,6 @@ MODULE_SCOPE int TclObjCallVarTraces(Interp *iPtr, Var *arrayPtr, */ MODULE_SCOPE int TclCompareObjKeys(void *keyPtr, Tcl_HashEntry *hPtr); -MODULE_SCOPE void TclFreeObj(Tcl_Obj *objPtr); MODULE_SCOPE void TclFreeObjEntry(Tcl_HashEntry *hPtr); MODULE_SCOPE TCL_HASH_TYPE TclHashObjKey(Tcl_HashTable *tablePtr, void *keyPtr); diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index a077a65..a19992d 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -512,7 +512,6 @@ static int uniCharNcasecmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsig # define Tcl_SetPanicProc 0 # define Tcl_FindExecutable 0 # define Tcl_GetUnicode 0 -# define TclOldFreeObj 0 # undef Tcl_StringMatch # define Tcl_StringMatch 0 # define TclBN_reverse 0 @@ -547,7 +546,6 @@ static int uniCharNcasecmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsig # define TclGetCommandFullName Tcl_GetCommandFullName # define TclpLocaltime_unix TclpLocaltime # define TclpGmtime_unix TclpGmtime -# define TclOldFreeObj TclFreeObj static int seekOld( @@ -1113,7 +1111,7 @@ const TclStubs tclStubs = { Tcl_DbNewObj, /* 27 */ Tcl_DbNewStringObj, /* 28 */ Tcl_DuplicateObj, /* 29 */ - TclOldFreeObj, /* 30 */ + TclFreeObj, /* 30 */ Tcl_GetBoolean, /* 31 */ Tcl_GetBooleanFromObj, /* 32 */ Tcl_GetByteArrayFromObj, /* 33 */ -- cgit v0.12 From 88e67d27d81cf6f4ddf89d85134b99f2e7950f66 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 15 Nov 2019 15:42:19 +0000 Subject: fix compliation warning, resulting from previous commit --- generic/tclOO.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclOO.c b/generic/tclOO.c index c9ef94f..c1db80c 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -1297,7 +1297,7 @@ int TclOODecrRefCount(Object *oPtr) { * ---------------------------------------------------------------------- */ int TclOOObjectDestroyed(Object *oPtr) { - oPtr->namespacePtr == NULL; + return (oPtr->namespacePtr == NULL); } /* -- cgit v0.12 From 12a22416413a587980cbb7d9c9bc361db5f3e419 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 15 Nov 2019 15:49:33 +0000 Subject: Fix test-case event-11.8, failing as a result of the TclOOObjectDestroyed() function restructuring. --- generic/tclOOMethod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 6f2612c..493c936 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -675,7 +675,7 @@ InvokeProcedureMethod( * the next thing in the chain. */ - if (!TclOOObjectDestroyed(((CallContext *)context)->oPtr) || + if (TclOOObjectDestroyed(((CallContext *)context)->oPtr) || Tcl_InterpDeleted(interp) ) { return TclNRObjectContextInvokeNext(interp, context, objc, objv, -- cgit v0.12 From 16135b4d33cd6d572f37f6c88cbce7f08db2cadb Mon Sep 17 00:00:00 2001 From: dgp Date: Sat, 16 Nov 2019 19:57:03 +0000 Subject: update changes --- changes | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 85 insertions(+), 19 deletions(-) diff --git a/changes b/changes index 9a15de6..bf50b63 100644 --- a/changes +++ b/changes @@ -8998,59 +8998,125 @@ in this changeset (new minor version) rather than bug fixes: 2017-11-01 (bug)[3c32a3] crash deleting class mixed into instance (coulter) -2017-11-03 (new)[TIP 345] eliminate the encoding 'identity' (porter) +2017-11-03 [TIP 345] eliminate the encoding 'identity' (porter) 2017-11-04 (bug)[0d902e] [string first] on ASCII stored as Unicode (fellows) -2017-11-17 (new)[TIP 422] Mark all Tcl_*VA() routines deprecated. (nijtmans) +2017-11-17 [TIP 422] Mark all Tcl_*VA() routines deprecated. (nijtmans) 2017-11-20 (support) Ended use of the obsolete values.h header (culler) 2017-11-30 (bug)[8e1e31] [lsort] ordering of U+0000 (nijtmans) -2017-12-07 (new)[TIP 487] Terminate support for pre-XP Windows (nijtmans) +2017-12-07 [TIP 487] Terminate support for pre-XP Windows (nijtmans) -2017-12-08 (new)[TIP 477] Reform of nmake build (nadkarni) +2017-12-08 [TIP 477] Reform of nmake build (nadkarni) 2017-12-20 (bug)[ba1419] Crash: complex ensemble delete, namespace-7.8 (coulter) -2018-01-17 (new)[TIP 485] Removal of many deprecated features (nijtmans) +2018-01-17 [TIP 485] Removal of many deprecated features (nijtmans) 2018-01-27 (bug) Crash in [join $l $l], join-4.1 (porter) -2018-02-06 (new)[TIP 493] Cease Distribution of http 1.0 (porter) +2018-02-06 [TIP 493] Cease Distribution of http 1.0 (porter) -2018-02-06 (new)[TIP 484] internal rep for native ints are all 64-bit (nijtmans) +2018-02-06 [TIP 484] internal rep for native ints are all 64-bit (nijtmans) -2018-02-14 (new)[TIP 476] Scan/Printf consistency (nijtmans) +2018-02-14 [TIP 476] Scan/Printf consistency (nijtmans) -2018-03-05 (new)[TIP 351] [lsearch] striding +2018-03-05 [TIP 351] [lsearch] striding -2018-03-05 (new)[TIPs 330,336] tighten access to Interp fields (porter) +2018-03-05 [TIPs 330,336] tighten access to Interp fields (porter) -2018-03-12 (new)[TIP 462] [::tcl::process] +2018-03-12 [TIP 462] [::tcl::process] -2018-03-12 (new)[TIP 490] add oo support for msgcat => msgcat 1.7.0 (oehlmann) +2018-03-12 [TIP 490] add oo support for msgcat => msgcat 1.7.0 (oehlmann) -2018-03-12 (new)[TIP 499] custom locale preference list (oehlmann) +2018-03-12 [TIP 499] custom locale preference list (oehlmann) => msgcat 1.7.0 -2018-03-20 (new)[TIP 503] End CONST84 support for Tcl 8.3 (porter) +2018-03-20 [TIP 503] End CONST84 support for Tcl 8.3 (porter) 2018-03-30 Refactored [lrange] (spjuth) -2018-04-20 (new)[TIP 389] Unicode beyond BMP (nijtmans) +2018-04-20 [TIP 389] Unicode beyond BMP (nijtmans) -2018-04-20 (new)[TIP 421] [array for] +2018-04-20 [TIP 421] [array for] -2018-05-11 (new)[TIP 425] Windows panic callback use of UTF-8 +2018-05-11 [TIP 425] Windows panic callback use of UTF-8 -2018-05-17 (new)[TIP 491] Phase out --disable-threads support +2018-05-17 [TIP 491] Phase out --disable-threads support -2018-06-03 (new)[TIP 500] TclOO Private Methods and Variables +2018-06-03 [TIP 500] TclOO Private Methods and Variables 2018-07-26 (bug)[ba921a] [string cat] of bytearrays (coulter,porter) +2018-09-02 [TIP 478] Many new features in TclOO (lester,fellows) +2018-09-04 (bug)[540bed] [binary format w] from bignum (nijtmans) + +2018-09-12 [TIP 430] zipfs and embedded script library (woods) + +2018-09-26 [TIP 508] [array default] (bonnet,fellows) + +2018-09-27 [TIP 515] level value reform (nijtmans) + +2018-09-27 [TIP 516] More OO slot operations (fellows) + +2018-09-27 [TIP 426] [info cmdtype] (fellows) + +2018-09-28 [TIP 509] Cross platform reentrant mutex + +2018-10-08 [TIP 514] native integers are 64-bit + +2018-10-12 [TIP 502] index value reform (porter) + +2018-11-06 [TIP 406] http cookies (fellows) + +2018-11-06 [TIP 445] Tcl_ObjType utilities (migrate to Tcl 9) (porter) + +2018-11-06 [TIP 501] [string is dict] + +2018-11-06 [TIP 519] inline export/unexport option for [oo::define] + +2018-11-06 [TIP 523] [lpop] + +2018-11-06 [TIP 524] TclOO custom dialects + +2018-11-06 [TIP 506] Tcl_(Incr|Decr)RefCount macros -> functions (porter) + +2018-11-15 [TIP 512] No stub for Tcl_SetExitProc() + +2019-04-08 (bug)[45b9fa] crash in [try] (coulter) + +2019-04-14 [TIP 160] terminal and serial channel controls + +2019-04-14 [TIP 312] more types for Tcl_LinkVar + +2019-04-14 [TIP 367] [lremove] + +2019-04-14 [TIP 504] [string insert] + +2019-04-16 [TIP 342] [dict getwithdefault] + +2019-05-25 [TIP 431] [file tempdir] + +2019-05-25 [TIP 383] [coroinject], [coroprobe] + +2019-05-31 [TIP 544] Tcl_GetIntForIndex() + +2019-06-12 Replace TclOffset() with offsetof() + +2019-06-15 [TIP 461] string compare operators for [expr] + +2019-06-16 [TIP 521] floating point classification functions for [expr] + +2019-06-20 (bug)[6bdadf] crash multi-arg traced [lappend] (fellows) + +2019-06-28 [TIP 547] New encodings utf-16, ucs-2 + +2019-09-14 [TIP 414] Tcl_InitSubsystems() + +2019-09-14 [TIP 548] wchar_t conversion functions - Released 8.7a3, Nov 21, 2019 --- http://core.tcl-lang.org/tcl/ for details - -- cgit v0.12 From 5997f60c9a9066ffd37d4ae9a3dd32dd07ace15e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 18 Nov 2019 20:22:32 +0000 Subject: Fix [13657a2dc3]: application/json is not a binary payload for http --- library/http/http.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/http/http.tcl b/library/http/http.tcl index 75898c9..c1a27a4 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -1181,7 +1181,7 @@ proc http::IsBinaryContentType {type} { # and so on. if {$major eq "application"} { set minor [string trimright $minor] - if {$minor in {"xml" "xml-external-parsed-entity" "xml-dtd"}} { + if {$minor in {"json" "xml" "xml-external-parsed-entity" "xml-dtd"}} { return false } } -- cgit v0.12 From cf11c42355fc78221b56e9dcb55ceff3b845b690 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 18 Nov 2019 20:27:57 +0000 Subject: http package from 2.7.14 to 2.7.15 --- library/http/http.tcl | 2 +- library/http/pkgIndex.tcl | 2 +- unix/Makefile.in | 4 ++-- win/Makefile.in | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/http/http.tcl b/library/http/http.tcl index c1a27a4..0852a26 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -11,7 +11,7 @@ package require Tcl 8.4 # Keep this in sync with pkgIndex.tcl and with the install directories in # Makefiles -package provide http 2.7.14 +package provide http 2.7.15 namespace eval http { # Allow resourcing to not clobber existing data diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index 3de8e25..89da540 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -1,4 +1,4 @@ # Tcl package index file, version 1.1 if {![package vsatisfies [package provide Tcl] 8.4]} {return} -package ifneeded http 2.7.14 [list tclPkgSetup $dir http 2.7.14 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] +package ifneeded http 2.7.15 [list tclPkgSetup $dir http 2.7.15 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] diff --git a/unix/Makefile.in b/unix/Makefile.in index 4f52929..751ab3e 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -777,8 +777,8 @@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/http1.0; \ done; - @echo "Installing package http 2.7.14 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/http-2.7.14.tm; + @echo "Installing package http 2.7.15 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/http-2.7.15.tm; @echo "Installing package opt0.4 files to $(SCRIPT_INSTALL_DIR)/opt0.4/"; @for i in $(TOP_DIR)/library/opt/*.tcl ; \ do \ diff --git a/win/Makefile.in b/win/Makefile.in index b7ff8bb..02c7ed8 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -662,8 +662,8 @@ install-libraries: libraries install-tzdata install-msgs do \ $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/http1.0"; \ done; - @echo "Installing package http 2.7.14 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/http-2.7.14.tm; + @echo "Installing package http 2.7.15 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/http-2.7.15.tm; @echo "Installing library opt0.4 directory"; @for j in $(ROOT_DIR)/library/opt/*.tcl; \ do \ -- cgit v0.12 From e722bb7121fccffe1e29652311c91ba85f2e33ff Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 21 Nov 2019 18:30:09 +0000 Subject: amend to [c93862b3bc] - fixes next timing test-issue in cmdMZ.test - measure without overhead now (otherwise net-time can be calculated too few); makes test results more verbose in the error case --- tests/cmdMZ.test | 51 +++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test index f72d39f..028a71b 100644 --- a/tests/cmdMZ.test +++ b/tests/cmdMZ.test @@ -353,9 +353,13 @@ test cmdMZ-5.4 {Tcl_TimeObjCmd: nothing happens with negative iteration counts} test cmdMZ-5.5 {Tcl_TimeObjCmd: result format} { regexp {^\d+ microseconds per iteration} [time {format 1}] } 1 -test cmdMZ-5.6 {Tcl_TimeObjCmd: slower commands take longer} { - expr {[lindex [time {_nrt_sleep 0.01}] 0] < [lindex [time {_nrt_sleep 10.0}] 0]} -} 1 +test cmdMZ-5.6 {Tcl_TimeObjCmd: slower commands take longer} -body { + set m1 [lindex [time {_nrt_sleep 0.01}] 0] + set m2 [lindex [time {_nrt_sleep 10.0}] 0] + list \ + [expr {$m1 < $m2}] \ + $m1 $m2; # interesting only in error case. +} -match glob -result [list 1 *] test cmdMZ-5.7 {Tcl_TimeObjCmd: errors generate right trace} { list [catch {time {error foo}} msg] $msg $::errorInfo } {1 foo {foo @@ -406,11 +410,10 @@ test cmdMZ-6.5a {Tcl_TimeRateObjCmd: result format and one iteration} { test cmdMZ-6.5b {Tcl_TimeRateObjCmd: result format without iterations} { regexp {^0 \ws/# 0 # 0 #/sec 0 net-ms$} [timerate {} 0 0] } 1 -test cmdMZ-6.6 {Tcl_TimeRateObjCmd: slower commands take longer, but it remains almost the same time of measument} { - lassign [timerate {_nrt_sleep 0} 50] ovh - set m1 [timerate -overhead $ovh {_nrt_sleep 0.01} 50] - set m2 [timerate -overhead $ovh {_nrt_sleep 1.00} 50] - list \ +test cmdMZ-6.6 {Tcl_TimeRateObjCmd: slower commands take longer, but it remains almost the same time of measument} -body { + set m1 [timerate {_nrt_sleep 0.01} 50] + set m2 [timerate {_nrt_sleep 1.00} 50] + list [list \ [expr {[lindex $m1 0] < [lindex $m2 0]}] \ [expr {[lindex $m1 0] < 100}] \ [expr {[lindex $m2 0] > 100}] \ @@ -419,8 +422,9 @@ test cmdMZ-6.6 {Tcl_TimeRateObjCmd: slower commands take longer, but it remains [expr {[lindex $m1 4] > 10000}] \ [expr {[lindex $m2 4] < 10000}] \ [expr {[lindex $m1 6] > 5 && [lindex $m1 6] < 100}] \ - [expr {[lindex $m2 6] > 5 && [lindex $m2 6] < 100}] -} [lrepeat 9 1] + [expr {[lindex $m2 6] > 5 && [lindex $m2 6] < 100}] \ + ] $m1 $m2; # interesting only in error case. +} -match glob -result [list [lrepeat 9 1] *] test cmdMZ-6.7 {Tcl_TimeRateObjCmd: errors generate right trace} { list [catch {timerate {error foo} 1} msg] $msg $::errorInfo } {1 foo {foo @@ -433,35 +437,38 @@ test cmdMZ-6.7.1 {Tcl_TimeRateObjCmd: return from timerate} { proc r1 {} {upvar x x; timerate {incr x; return "r1"; incr x} 1000 10} list [r1] $x } {r1 1} -test cmdMZ-6.8 {Tcl_TimeRateObjCmd: allow (conditional) break from timerate} { +test cmdMZ-6.8 {Tcl_TimeRateObjCmd: allow (conditional) break from timerate} -body { set m1 [timerate {break}] - list \ + list [list \ [expr {[lindex $m1 0] < 1000}] \ [expr {[lindex $m1 2] == 1}] \ [expr {[lindex $m1 4] > 1000}] \ - [expr {[lindex $m1 6] < 10}] -} {1 1 1 1} -test cmdMZ-6.8.1 {Tcl_TimeRateObjCmd: allow (conditional) continue in timerate} { + [expr {[lindex $m1 6] < 10}] \ + ] $m1; # interesting only in error case. +} -match glob -result [list {1 1 1 1} *] +test cmdMZ-6.8.1 {Tcl_TimeRateObjCmd: allow (conditional) continue in timerate} -body { set m1 [timerate {continue; return -code error "unexpected"} 1000 10] - list \ + list [list \ [expr {[lindex $m1 0] < 1000}] \ [expr {[lindex $m1 2] == 10}] \ [expr {[lindex $m1 4] > 1000}] \ - [expr {[lindex $m1 6] < 100}] -} {1 1 1 1} + [expr {[lindex $m1 6] < 100}] \ + ] $m1; # interesting only in error case. +} -match glob -result [list {1 1 1 1} *] test cmdMZ-6.9 {Tcl_TimeRateObjCmd: max count of iterations} { set m1 [timerate {} 1000 5]; # max-count wins set m2 [timerate {_nrt_sleep 20} 1 5]; # max-time wins list [lindex $m1 2] [lindex $m2 2] } {5 1} -test cmdMZ-6.10 {Tcl_TimeRateObjCmd: huge overhead cause 0us result} { +test cmdMZ-6.10 {Tcl_TimeRateObjCmd: huge overhead cause 0us result} -body { set m1 [timerate -overhead 1e6 {_nrt_sleep 10} 100 1] - list \ + list [list \ [expr {[lindex $m1 0] == 0.0}] \ [expr {[lindex $m1 2] == 1}] \ [expr {[lindex $m1 4] == 1000000}] \ - [expr {[lindex $m1 6] <= 0.001}] -} {1 1 1 1} + [expr {[lindex $m1 6] <= 0.001}] \ + ] $m1; # interesting only in error case. +} -match glob -result [list {1 1 1 1} *] test cmdMZ-6.11 {Tcl_TimeRateObjCmd: done/continue optimization rollback} { set m1 {set m2 ok} if 1 $m1 -- cgit v0.12 From 931120cefe4e631de9e88bcb524390dc766094a9 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Fri, 22 Nov 2019 04:04:48 +0000 Subject: Fix generation of VERSIONINFO in RC files when package versions have 4 or more components or use "a" or "b" as version separators. Previously they would result in the resource compiler generating an error. --- win/rules.vc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/win/rules.vc b/win/rules.vc index cf80c91..2061e9b 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -24,7 +24,7 @@ _RULES_VC = 1 # For modifications that are not backward-compatible, you *must* change # the major version. RULES_VERSION_MAJOR = 1 -RULES_VERSION_MINOR = 4 +RULES_VERSION_MINOR = 5 # The PROJECT macro must be defined by parent makefile. !if "$(PROJECT)" == "" @@ -985,6 +985,19 @@ VERSION = $(DOTVERSION:.=) !endif # $(DOING_TCL) ... etc. +# Windows RC files have 3 version components. Ensure this irrespective +# of how many components the package has specified. Basically, ensure +# minimum 4 components by appending 4 0's and then pick out the first 4. +# Also take care of the fact that DOTVERSION may have "a" or "b" instead +# of "." separating the version components. +DOTSEPARATED=$(DOTVERSION:a=.) +DOTSEPARATED=$(DOTSEPARATED:b=.) +!if [echo RCCOMMAVERSION = \> versions.vc] \ + || [for /f "tokens=1,2,3,4,5* delims=." %a in ("$(DOTSEPARATED).0.0.0.0") do echo %a,%b,%c,%d >> versions.vc] +!error *** Could not generate RCCOMMAVERSION *** +!endif +!include versions.vc + ################################################################ # 10. Construct output directory and file paths # Figure-out how to name our intermediate and output directories. @@ -1508,7 +1521,7 @@ GUIEXECMD = $(link32) $(guilflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs) RESCMD = $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \ $(TCL_INCLUDES) \ /DDEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \ - /DCOMMAVERSION=$(DOTVERSION:.=,),0 \ + /DCOMMAVERSION=$(RCCOMMAVERSION) \ /DDOTVERSION=\"$(DOTVERSION)\" \ /DVERSION=\"$(VERSION)\" \ /DSUFX=\"$(SUFX)\" \ -- cgit v0.12 From 91a9b97aa6770bc5f963683b0cb3a4f9beebe33e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 25 Nov 2019 16:40:32 +0000 Subject: Fix 2 version numbers in Makefile echo's (just misleading). Thanks to Pietro Cerutti for noticing this. --- unix/Makefile.in | 2 +- win/Makefile.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 3b6b295..8d74cc3 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1035,7 +1035,7 @@ install-libraries: libraries @echo "Installing package msgcat 1.7.0 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl \ "$(MODULE_INSTALL_DIR)"/tcl8/8.7/msgcat-1.7.0.tm - @echo "Installing package tcltest 2.5.0 as a Tcl Module" + @echo "Installing package tcltest 2.5.1 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl \ "$(MODULE_INSTALL_DIR)"/tcl8/8.5/tcltest-2.5.1.tm @echo "Installing package platform 1.0.14 as a Tcl Module" diff --git a/win/Makefile.in b/win/Makefile.in index 62a5305..1c2057a 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -872,7 +872,7 @@ install-libraries: libraries install-tzdata install-msgs done; @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"; + @echo "Installing package tcltest 2.5.1 as a Tcl Module"; @$(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; -- cgit v0.12 From b427bd59d04ab499ea215aa66e2cdfd320ee8b77 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 25 Nov 2019 16:41:51 +0000 Subject: Makefiles got out of sync with tcltest version. --- unix/Makefile.in | 4 ++-- win/Makefile.in | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 751ab3e..ea89d11 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -786,8 +786,8 @@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs done; @echo "Installing package msgcat 1.5.2 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.5.2.tm; - @echo "Installing package tcltest 2.5.0 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.5.0.tm; + @echo "Installing package tcltest 2.5.1 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_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"; @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.14.tm; diff --git a/win/Makefile.in b/win/Makefile.in index 02c7ed8..768711a 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -671,8 +671,8 @@ install-libraries: libraries install-tzdata install-msgs done; @echo "Installing package msgcat 1.5.2 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.5.2.tm; - @echo "Installing package tcltest 2.5.0 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.5.0.tm; + @echo "Installing package tcltest 2.5.1 as a Tcl Module"; + @$(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"; -- cgit v0.12 From 582196abb892f5a7a487da81005747ebdef32c59 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 26 Nov 2019 11:16:12 +0000 Subject: Move the cookiejar package to its own directory so http works as a TM. Fix the unix installation code to include the bootstrap registrar names. --- library/cookiejar/cookiejar.tcl | 745 +++++++++++++++++++++++++++ library/cookiejar/effective_tld_names.txt.gz | Bin 0 -> 70836 bytes library/cookiejar/idna.tcl | 292 +++++++++++ library/cookiejar/pkgIndex.tcl | 3 + library/http/cookiejar.tcl | 745 --------------------------- library/http/effective_tld_names.txt.gz | Bin 70836 -> 0 bytes library/http/idna.tcl | 292 ----------- library/http/pkgIndex.tcl | 2 - unix/Makefile.in | 7 +- 9 files changed, 1046 insertions(+), 1040 deletions(-) create mode 100644 library/cookiejar/cookiejar.tcl create mode 100644 library/cookiejar/effective_tld_names.txt.gz create mode 100644 library/cookiejar/idna.tcl create mode 100644 library/cookiejar/pkgIndex.tcl delete mode 100644 library/http/cookiejar.tcl delete mode 100644 library/http/effective_tld_names.txt.gz delete mode 100644 library/http/idna.tcl diff --git a/library/cookiejar/cookiejar.tcl b/library/cookiejar/cookiejar.tcl new file mode 100644 index 0000000..2eae877 --- /dev/null +++ b/library/cookiejar/cookiejar.tcl @@ -0,0 +1,745 @@ +# cookiejar.tcl -- +# +# Implementation of an HTTP cookie storage engine using SQLite. The +# implementation is done as a TclOO class, and includes a punycode +# encoder and decoder (though only the encoder is currently used). +# +# See the file "license.terms" for information on usage and redistribution of +# this file, and for a DISCLAIMER OF ALL WARRANTIES. + +# Dependencies +package require Tcl 8.6 +package require http 2.8.4 +package require sqlite3 +package require tcl::idna 1.0 + +# +# Configuration for the cookiejar package, plus basic support procedures. +# + +# This is the class that we are creating +if {![llength [info commands ::http::cookiejar]]} { + ::oo::class create ::http::cookiejar +} + +namespace eval [info object namespace ::http::cookiejar] { + proc setInt {*var val} { + upvar 1 ${*var} var + if {[catch {incr dummy $val} msg]} { + return -code error $msg + } + set var $val + } + proc setInterval {trigger *var val} { + upvar 1 ${*var} var + if {![string is integer -strict $val] || $val < 1} { + return -code error "expected positive integer but got \"$val\"" + } + set var $val + {*}$trigger + } + proc setBool {*var val} { + upvar 1 ${*var} var + if {[catch {if {$val} {}} msg]} { + return -code error $msg + } + set var [expr {!!$val}] + } + + proc setLog {*var val} { + upvar 1 ${*var} var + set var [::tcl::prefix match -message "log level" \ + {debug info warn error} $val] + } + + # Keep this in sync with pkgIndex.tcl and with the install directories in + # Makefiles + variable version 0.1 + + variable domainlist \ + http://publicsuffix.org/list/effective_tld_names.dat + variable domainfile \ + [file join [file dirname [info script]] effective_tld_names.txt.gz] + # The list is directed to from http://publicsuffix.org/list/ + variable loglevel info + variable vacuumtrigger 200 + variable retainlimit 100 + variable offline false + variable purgeinterval 60000 + variable refreshinterval 10000000 + variable domaincache {} + + # Some support procedures, none particularly useful in general + namespace eval support { + # Set up a logger if the http package isn't actually loaded yet. + if {![llength [info commands ::http::Log]]} { + proc ::http::Log args { + # Do nothing by default... + } + } + + namespace export * + proc locn {secure domain path {key ""}} { + if {$key eq ""} { + format "%s://%s%s" [expr {$secure?"https":"http"}] \ + [::tcl::idna encode $domain] $path + } else { + format "%s://%s%s?%s" \ + [expr {$secure?"https":"http"}] [::tcl::idna encode $domain] \ + $path $key + } + } + proc splitDomain domain { + set pieces [split $domain "."] + for {set i [llength $pieces]} {[incr i -1] >= 0} {} { + lappend result [join [lrange $pieces $i end] "."] + } + return $result + } + proc splitPath path { + set pieces [split [string trimleft $path "/"] "/"] + for {set j -1} {$j < [llength $pieces]} {incr j} { + lappend result /[join [lrange $pieces 0 $j] "/"] + } + return $result + } + proc isoNow {} { + set ms [clock milliseconds] + set ts [expr {$ms / 1000}] + set ms [format %03d [expr {$ms % 1000}]] + clock format $ts -format "%Y%m%dT%H%M%S.${ms}Z" -gmt 1 + } + proc log {level msg args} { + namespace upvar [info object namespace ::http::cookiejar] \ + loglevel loglevel + set who [uplevel 1 self class] + set mth [uplevel 1 self method] + set map {debug 0 info 1 warn 2 error 3} + if {[string map $map $level] >= [string map $map $loglevel]} { + set msg [format $msg {*}$args] + set LVL [string toupper $level] + ::http::Log "[isoNow] $LVL $who $mth - $msg" + } + } + } +} + +# Now we have enough information to provide the package. +package provide cookiejar \ + [set [info object namespace ::http::cookiejar]::version] + +# The implementation of the cookiejar package +::oo::define ::http::cookiejar { + self { + method configure {{optionName "\u0000\u0000"} {optionValue "\u0000\u0000"}} { + set tbl { + -domainfile {domainfile set} + -domainlist {domainlist set} + -domainrefresh {refreshinterval setInterval} + -loglevel {loglevel setLog} + -offline {offline setBool} + -purgeold {purgeinterval setInterval} + -retain {retainlimit setInt} + -vacuumtrigger {vacuumtrigger setInt} + } + dict lappend tbl -domainrefresh [namespace code { + my IntervalTrigger PostponeRefresh + }] + dict lappend tbl -purgeold [namespace code { + my IntervalTrigger PostponePurge + }] + if {$optionName eq "\u0000\u0000"} { + return [dict keys $tbl] + } + set opt [::tcl::prefix match -message "option" \ + [dict keys $tbl] $optionName] + set setter [lassign [dict get $tbl $opt] varname] + namespace upvar [namespace current] $varname var + if {$optionValue ne "\u0000\u0000"} { + {*}$setter var $optionValue + } + return $var + } + + method IntervalTrigger {method} { + # TODO: handle subclassing + foreach obj [info class instances [self]] { + [info object namespace $obj]::my $method + } + } + } + + variable purgeTimer deletions refreshTimer + constructor {{path ""}} { + namespace import [info object namespace [self class]]::support::* + + if {$path eq ""} { + sqlite3 [namespace current]::db :memory: + set storeorigin "constructed cookie store in memory" + } else { + sqlite3 [namespace current]::db $path + db timeout 500 + set storeorigin "loaded cookie store from $path" + } + + set deletions 0 + db transaction { + db eval { + --;# Store the persistent cookies in this table. + --;# Deletion policy: once they expire, or if explicitly + --;# killed. + CREATE TABLE IF NOT EXISTS persistentCookies ( + id INTEGER PRIMARY KEY, + secure INTEGER NOT NULL, + domain TEXT NOT NULL COLLATE NOCASE, + path TEXT NOT NULL, + key TEXT NOT NULL, + value TEXT NOT NULL, + originonly INTEGER NOT NULL, + expiry INTEGER NOT NULL, + lastuse INTEGER NOT NULL, + creation INTEGER NOT NULL); + CREATE UNIQUE INDEX IF NOT EXISTS persistentUnique + ON persistentCookies (domain, path, key); + CREATE INDEX IF NOT EXISTS persistentLookup + ON persistentCookies (domain, path); + + --;# Store the session cookies in this table. + --;# Deletion policy: at cookiejar instance deletion, if + --;# explicitly killed, or if the number of session cookies is + --;# too large and the cookie has not been used recently. + CREATE TEMP TABLE sessionCookies ( + id INTEGER PRIMARY KEY, + secure INTEGER NOT NULL, + domain TEXT NOT NULL COLLATE NOCASE, + path TEXT NOT NULL, + key TEXT NOT NULL, + originonly INTEGER NOT NULL, + value TEXT NOT NULL, + lastuse INTEGER NOT NULL, + creation INTEGER NOT NULL); + CREATE UNIQUE INDEX sessionUnique + ON sessionCookies (domain, path, key); + CREATE INDEX sessionLookup ON sessionCookies (domain, path); + + --;# View to allow for simple looking up of a cookie. + --;# Deletion policy: NOT SUPPORTED via this view. + CREATE TEMP VIEW cookies AS + SELECT id, domain, ( + CASE originonly WHEN 1 THEN path ELSE '.' || path END + ) AS path, key, value, secure, 1 AS persistent + FROM persistentCookies + UNION + SELECT id, domain, ( + CASE originonly WHEN 1 THEN path ELSE '.' || path END + ) AS path, key, value, secure, 0 AS persistent + FROM sessionCookies; + + --;# Encoded domain permission policy; if forbidden is 1, no + --;# cookie may be ever set for the domain, and if forbidden + --;# is 0, cookies *may* be created for the domain (overriding + --;# the forbiddenSuper table). + --;# Deletion policy: normally not modified. + CREATE TABLE IF NOT EXISTS domains ( + domain TEXT PRIMARY KEY NOT NULL, + forbidden INTEGER NOT NULL); + + --;# Domains that may not have a cookie defined for direct + --;# child domains of them. + --;# Deletion policy: normally not modified. + CREATE TABLE IF NOT EXISTS forbiddenSuper ( + domain TEXT PRIMARY KEY); + + --;# When we last retrieved the domain list. + CREATE TABLE IF NOT EXISTS domainCacheMetadata ( + id INTEGER PRIMARY KEY, + retrievalDate INTEGER, + installDate INTEGER); + } + + set cookieCount "no" + db eval { + SELECT COUNT(*) AS cookieCount FROM persistentCookies + } + log info "%s with %s entries" $storeorigin $cookieCount + + my PostponePurge + + if {$path ne ""} { + if {[db exists {SELECT 1 FROM domains}]} { + my RefreshDomains + } else { + my InitDomainList + my PostponeRefresh + } + } else { + set data [my GetDomainListOffline metadata] + my InstallDomainData $data $metadata + my PostponeRefresh + } + } + } + + method PostponePurge {} { + namespace upvar [info object namespace [self class]] \ + purgeinterval interval + catch {after cancel $purgeTimer} + set purgeTimer [after $interval [namespace code {my PurgeCookies}]] + } + + method PostponeRefresh {} { + namespace upvar [info object namespace [self class]] \ + refreshinterval interval + catch {after cancel $refreshTimer} + set refreshTimer [after $interval [namespace code {my RefreshDomains}]] + } + + method RefreshDomains {} { + # TODO: domain list refresh policy + my PostponeRefresh + } + + method HttpGet {url {timeout 0} {maxRedirects 5}} { + for {set r 0} {$r < $maxRedirects} {incr r} { + set tok [::http::geturl $url -timeout $timeout] + try { + if {[::http::status $tok] eq "timeout"} { + return -code error "connection timed out" + } elseif {[::http::ncode $tok] == 200} { + return [::http::data $tok] + } elseif {[::http::ncode $tok] >= 400} { + return -code error [::http::error $tok] + } elseif {[dict exists [::http::meta $tok] Location]} { + set url [dict get [::http::meta $tok] Location] + continue + } + return -code error \ + "unexpected state: [::http::code $tok]" + } finally { + ::http::cleanup $tok + } + } + return -code error "too many redirects" + } + method GetDomainListOnline {metaVar} { + upvar 1 $metaVar meta + namespace upvar [info object namespace [self class]] \ + domainlist url domaincache cache + lassign $cache when data + if {$when > [clock seconds] - 3600} { + log debug "using cached value created at %s" \ + [clock format $when -format {%Y%m%dT%H%M%SZ} -gmt 1] + dict set meta retrievalDate $when + return $data + } + log debug "loading domain list from %s" $url + try { + set when [clock seconds] + set data [my HttpGet $url] + set cache [list $when $data] + # TODO: Should we use the Last-Modified header instead? + dict set meta retrievalDate $when + return $data + } on error msg { + log error "failed to fetch list of forbidden cookie domains from %s: %s" \ + $url $msg + return {} + } + } + method GetDomainListOffline {metaVar} { + upvar 1 $metaVar meta + namespace upvar [info object namespace [self class]] \ + domainfile filename + log debug "loading domain list from %s" $filename + try { + set f [open $filename] + try { + if {[string match *.gz $filename]} { + zlib push gunzip $f + } + fconfigure $f -encoding utf-8 + dict set meta retrievalDate [file mtime $filename] + return [read $f] + } finally { + close $f + } + } on error {msg opt} { + log error "failed to read list of forbidden cookie domains from %s: %s" \ + $filename $msg + return -options $opt $msg + } + } + method InitDomainList {} { + namespace upvar [info object namespace [self class]] \ + offline offline + if {!$offline} { + try { + set data [my GetDomainListOnline metadata] + if {[string length $data]} { + my InstallDomainData $data $metadata + return + } + } on error {} { + log warn "attempting to fall back to built in version" + } + } + set data [my GetDomainListOffline metadata] + my InstallDomainData $data $metadata + } + + method InstallDomainData {data meta} { + set n [db total_changes] + db transaction { + foreach line [split $data "\n"] { + if {[string trim $line] eq ""} { + continue + } elseif {[string match //* $line]} { + continue + } elseif {[string match !* $line]} { + set line [string range $line 1 end] + set idna [string tolower [::tcl::idna encode $line]] + set utf [::tcl::idna decode [string tolower $line]] + db eval { + INSERT OR REPLACE INTO domains (domain, forbidden) + VALUES ($utf, 0); + } + if {$idna ne $utf} { + db eval { + INSERT OR REPLACE INTO domains (domain, forbidden) + VALUES ($idna, 0); + } + } + } else { + if {[string match {\*.*} $line]} { + set line [string range $line 2 end] + set idna [string tolower [::tcl::idna encode $line]] + set utf [::tcl::idna decode [string tolower $line]] + db eval { + INSERT OR REPLACE INTO forbiddenSuper (domain) + VALUES ($utf); + } + if {$idna ne $utf} { + db eval { + INSERT OR REPLACE INTO forbiddenSuper (domain) + VALUES ($idna); + } + } + } else { + set idna [string tolower [::tcl::idna encode $line]] + set utf [::tcl::idna decode [string tolower $line]] + } + db eval { + INSERT OR REPLACE INTO domains (domain, forbidden) + VALUES ($utf, 1); + } + if {$idna ne $utf} { + db eval { + INSERT OR REPLACE INTO domains (domain, forbidden) + VALUES ($idna, 1); + } + } + } + if {$utf ne [::tcl::idna decode [string tolower $idna]]} { + log warn "mismatch in IDNA handling for %s (%d, %s, %s)" \ + $idna $line $utf [::tcl::idna decode $idna] + } + } + + dict with meta { + set installDate [clock seconds] + db eval { + INSERT OR REPLACE INTO domainCacheMetadata + (id, retrievalDate, installDate) + VALUES (1, $retrievalDate, $installDate); + } + } + } + set n [expr {[db total_changes] - $n}] + log info "constructed domain info with %d entries" $n + } + + # This forces the rebuild of the domain data, loading it from + method forceLoadDomainData {} { + db transaction { + db eval { + DELETE FROM domains; + DELETE FROM forbiddenSuper; + INSERT OR REPLACE INTO domainCacheMetadata + (id, retrievalDate, installDate) + VALUES (1, -1, -1); + } + my InitDomainList + } + } + + destructor { + catch { + after cancel $purgeTimer + } + catch { + after cancel $refreshTimer + } + catch { + db close + } + return + } + + method GetCookiesForHostAndPath {listVar secure host path fullhost} { + upvar 1 $listVar result + log debug "check for cookies for %s" [locn $secure $host $path] + set exact [expr {$host eq $fullhost}] + db eval { + SELECT key, value FROM persistentCookies + WHERE domain = $host AND path = $path AND secure <= $secure + AND (NOT originonly OR domain = $fullhost) + AND originonly = $exact + } { + lappend result $key $value + db eval { + UPDATE persistentCookies SET lastuse = $now WHERE id = $id + } + } + set now [clock seconds] + db eval { + SELECT id, key, value FROM sessionCookies + WHERE domain = $host AND path = $path AND secure <= $secure + AND (NOT originonly OR domain = $fullhost) + AND originonly = $exact + } { + lappend result $key $value + db eval { + UPDATE sessionCookies SET lastuse = $now WHERE id = $id + } + } + } + + method getCookies {proto host path} { + set result {} + set paths [splitPath $path] + if {[regexp {[^0-9.]} $host]} { + set domains [splitDomain [string tolower [::tcl::idna encode $host]]] + } else { + # Ugh, it's a numeric domain! Restrict it to just itself... + set domains [list $host] + } + set secure [string equal -nocase $proto "https"] + # Open question: how to move these manipulations into the database + # engine (if that's where they *should* be). + # + # Suggestion from kbk: + #LENGTH(theColumn) <= LENGTH($queryStr) AND + #SUBSTR(theColumn, LENGTH($queryStr) LENGTH(theColumn)+1) = $queryStr + # + # However, we instead do most of the work in Tcl because that lets us + # do the splitting exactly right, and it's far easier to work with + # strings in Tcl than in SQL. + db transaction { + foreach domain $domains { + foreach p $paths { + my GetCookiesForHostAndPath result $secure $domain $p $host + } + } + return $result + } + } + + method BadDomain options { + if {![dict exists $options domain]} { + log error "no domain present in options" + return 0 + } + dict with options {} + if {$domain ne $origin} { + log debug "cookie domain varies from origin (%s, %s)" \ + $domain $origin + if {[string match .* $domain]} { + set dotd $domain + } else { + set dotd .$domain + } + if {![string equal -length [string length $dotd] \ + [string reverse $dotd] [string reverse $origin]]} { + log warn "bad cookie: domain not suffix of origin" + return 1 + } + } + if {![regexp {[^0-9.]} $domain]} { + if {$domain eq $origin} { + # May set for itself + return 0 + } + log warn "bad cookie: for a numeric address" + return 1 + } + db eval { + SELECT forbidden FROM domains WHERE domain = $domain + } { + if {$forbidden} { + log warn "bad cookie: for a forbidden address" + } + return $forbidden + } + if {[regexp {^[^.]+\.(.+)$} $domain -> super] && [db exists { + SELECT 1 FROM forbiddenSuper WHERE domain = $super + }]} then { + log warn "bad cookie: for a forbidden address" + return 1 + } + return 0 + } + + # A defined extension point to allow users to easily impose extra policies + # on whether to accept cookies from a particular domain and path. + method policyAllow {operation domain path} { + return true + } + + method storeCookie {options} { + db transaction { + if {[my BadDomain $options]} { + return + } + set now [clock seconds] + set persistent [dict exists $options expires] + dict with options {} + if {!$persistent} { + if {![my policyAllow session $domain $path]} { + log warn "bad cookie: $domain prohibited by user policy" + return + } + db eval { + INSERT OR REPLACE INTO sessionCookies ( + secure, domain, path, key, value, originonly, creation, + lastuse) + VALUES ($secure, $domain, $path, $key, $value, $hostonly, + $now, $now); + DELETE FROM persistentCookies + WHERE domain = $domain AND path = $path AND key = $key + AND secure <= $secure AND originonly = $hostonly + } + incr deletions [db changes] + log debug "defined session cookie for %s" \ + [locn $secure $domain $path $key] + } elseif {$expires < $now} { + if {![my policyAllow delete $domain $path]} { + log warn "bad cookie: $domain prohibited by user policy" + return + } + db eval { + DELETE FROM persistentCookies + WHERE domain = $domain AND path = $path AND key = $key + AND secure <= $secure AND originonly = $hostonly + } + set del [db changes] + db eval { + DELETE FROM sessionCookies + WHERE domain = $domain AND path = $path AND key = $key + AND secure <= $secure AND originonly = $hostonly + } + incr deletions [incr del [db changes]] + log debug "deleted %d cookies for %s" \ + $del [locn $secure $domain $path $key] + } else { + if {![my policyAllow set $domain $path]} { + log warn "bad cookie: $domain prohibited by user policy" + return + } + db eval { + INSERT OR REPLACE INTO persistentCookies ( + secure, domain, path, key, value, originonly, expiry, + creation, lastuse) + VALUES ($secure, $domain, $path, $key, $value, $hostonly, + $expires, $now, $now); + DELETE FROM sessionCookies + WHERE domain = $domain AND path = $path AND key = $key + AND secure <= $secure AND originonly = $hostonly + } + incr deletions [db changes] + log debug "defined persistent cookie for %s, expires at %s" \ + [locn $secure $domain $path $key] \ + [clock format $expires] + } + } + } + + method PurgeCookies {} { + namespace upvar [info object namespace [self class]] \ + vacuumtrigger trigger retainlimit retain + my PostponePurge + set now [clock seconds] + log debug "purging cookies that expired before %s" [clock format $now] + db transaction { + db eval { + DELETE FROM persistentCookies WHERE expiry < $now + } + incr deletions [db changes] + db eval { + DELETE FROM persistentCookies WHERE id IN ( + SELECT id FROM persistentCookies ORDER BY lastuse ASC + LIMIT -1 OFFSET $retain) + } + incr deletions [db changes] + db eval { + DELETE FROM sessionCookies WHERE id IN ( + SELECT id FROM sessionCookies ORDER BY lastuse + LIMIT -1 OFFSET $retain) + } + incr deletions [db changes] + } + + # Once we've deleted a fair bit, vacuum the database. Must be done + # outside a transaction. + if {$deletions > $trigger} { + set deletions 0 + log debug "vacuuming cookie database" + catch { + db eval { + VACUUM + } + } + } + } + + forward Database db + + method lookup {{host ""} {key ""}} { + set host [string tolower [::tcl::idna encode $host]] + db transaction { + if {$host eq ""} { + set result {} + db eval { + SELECT DISTINCT domain FROM cookies + ORDER BY domain + } { + lappend result [::tcl::idna decode [string tolower $domain]] + } + return $result + } elseif {$key eq ""} { + set result {} + db eval { + SELECT DISTINCT key FROM cookies + WHERE domain = $host + ORDER BY key + } { + lappend result $key + } + return $result + } else { + db eval { + SELECT value FROM cookies + WHERE domain = $host AND key = $key + LIMIT 1 + } { + return $value + } + return -code error "no such key for that host" + } + } + } +} + +# Local variables: +# mode: tcl +# fill-column: 78 +# End: diff --git a/library/cookiejar/effective_tld_names.txt.gz b/library/cookiejar/effective_tld_names.txt.gz new file mode 100644 index 0000000..13e08bb Binary files /dev/null and b/library/cookiejar/effective_tld_names.txt.gz differ diff --git a/library/cookiejar/idna.tcl b/library/cookiejar/idna.tcl new file mode 100644 index 0000000..2a7d289 --- /dev/null +++ b/library/cookiejar/idna.tcl @@ -0,0 +1,292 @@ +# cookiejar.tcl -- +# +# Implementation of IDNA (Internationalized Domain Names for +# Applications) encoding/decoding system, built on a punycode engine +# developed directly from the code in RFC 3492, Appendix C (with +# substantial modifications). +# +# This implementation includes code from that RFC, translated to Tcl; the +# other parts are: +# Copyright (c) 2014 Donal K. Fellows +# +# See the file "license.terms" for information on usage and redistribution of +# this file, and for a DISCLAIMER OF ALL WARRANTIES. + +namespace eval ::tcl::idna { + namespace ensemble create -command puny -map { + encode punyencode + decode punydecode + } + namespace ensemble create -command ::tcl::idna -map { + encode IDNAencode + decode IDNAdecode + puny puny + version {::apply {{} {package present tcl::idna} ::}} + } + + proc IDNAencode hostname { + set parts {} + # Split term from RFC 3490, Sec 3.1 + foreach part [split $hostname "\u002E\u3002\uFF0E\uFF61"] { + if {[regexp {[^-A-Za-z0-9]} $part]} { + if {[regexp {[^-A-Za-z0-9\u00a1-\uffff]} $part ch]} { + scan $ch %c c + if {$ch < "!" || $ch > "~"} { + set ch [format "\\u%04x" $c] + } + throw [list IDNA INVALID_NAME_CHARACTER $ch] \ + "bad character \"$ch\" in DNS name" + } + set part xn--[punyencode $part] + # Length restriction from RFC 5890, Sec 2.3.1 + if {[string length $part] > 63} { + throw [list IDNA OVERLONG_PART $part] \ + "hostname part too long" + } + } + lappend parts $part + } + return [join $parts .] + } + proc IDNAdecode hostname { + set parts {} + # Split term from RFC 3490, Sec 3.1 + foreach part [split $hostname "\u002E\u3002\uFF0E\uFF61"] { + if {[string match -nocase "xn--*" $part]} { + set part [punydecode [string range $part 4 end]] + } + lappend parts $part + } + return [join $parts .] + } + + variable digits [split "abcdefghijklmnopqrstuvwxyz0123456789" ""] + # Bootstring parameters for Punycode + variable base 36 + variable tmin 1 + variable tmax 26 + variable skew 38 + variable damp 700 + variable initial_bias 72 + variable initial_n 0x80 + + variable max_codepoint 0x10FFFF + + proc adapt {delta first numchars} { + variable base + variable tmin + variable tmax + variable damp + variable skew + + set delta [expr {$delta / ($first ? $damp : 2)}] + incr delta [expr {$delta / $numchars}] + set k 0 + while {$delta > ($base - $tmin) * $tmax / 2} { + set delta [expr {$delta / ($base-$tmin)}] + incr k $base + } + return [expr {$k + ($base-$tmin+1) * $delta / ($delta+$skew)}] + } + + # Main punycode encoding function + proc punyencode {string {case ""}} { + variable digits + variable tmin + variable tmax + variable base + variable initial_n + variable initial_bias + + if {![string is boolean $case]} { + return -code error "\"$case\" must be boolean" + } + + set in {} + foreach char [set string [split $string ""]] { + scan $char "%c" ch + lappend in $ch + } + set output {} + + # Initialize the state: + set n $initial_n + set delta 0 + set bias $initial_bias + + # Handle the basic code points: + foreach ch $string { + if {$ch < "\u0080"} { + if {$case eq ""} { + append output $ch + } elseif {[string is true $case]} { + append output [string toupper $ch] + } elseif {[string is false $case]} { + append output [string tolower $ch] + } + } + } + + set b [string length $output] + + # h is the number of code points that have been handled, b is the + # number of basic code points. + + if {$b > 0} { + append output "-" + } + + # Main encoding loop: + + for {set h $b} {$h < [llength $in]} {incr delta; incr n} { + # All non-basic code points < n have been handled already. Find + # the next larger one: + + set m inf + foreach ch $in { + if {$ch >= $n && $ch < $m} { + set m $ch + } + } + + # Increase delta enough to advance the decoder's state to + # , but guard against overflow: + + if {$m-$n > (0xffffffff-$delta)/($h+1)} { + throw {PUNYCODE OVERFLOW} "overflow in delta computation" + } + incr delta [expr {($m-$n) * ($h+1)}] + set n $m + + foreach ch $in { + if {$ch < $n && ([incr delta] & 0xffffffff) == 0} { + throw {PUNYCODE OVERFLOW} "overflow in delta computation" + } + + if {$ch != $n} { + continue + } + + # Represent delta as a generalized variable-length integer: + + for {set q $delta; set k $base} true {incr k $base} { + set t [expr {min(max($k-$bias, $tmin), $tmax)}] + if {$q < $t} { + break + } + append output \ + [lindex $digits [expr {$t + ($q-$t)%($base-$t)}]] + set q [expr {($q-$t) / ($base-$t)}] + } + + append output [lindex $digits $q] + set bias [adapt $delta [expr {$h==$b}] [expr {$h+1}]] + set delta 0 + incr h + } + } + + return $output + } + + # Main punycode decode function + proc punydecode {string {case ""}} { + variable tmin + variable tmax + variable base + variable initial_n + variable initial_bias + variable max_codepoint + + if {![string is boolean $case]} { + return -code error "\"$case\" must be boolean" + } + + # Initialize the state: + + set n $initial_n + set i 0 + set first 1 + set bias $initial_bias + + # Split the string into the "real" ASCII characters and the ones to + # feed into the main decoder. Note that we don't need to check the + # result of [regexp] because that RE will technically match any string + # at all. + + regexp {^(?:(.*)-)?([^-]*)$} $string -> pre post + if {[string is true -strict $case]} { + set pre [string toupper $pre] + } elseif {[string is false -strict $case]} { + set pre [string tolower $pre] + } + set output [split $pre ""] + set out [llength $output] + + # Main decoding loop: + + for {set in 0} {$in < [string length $post]} {incr in} { + # Decode a generalized variable-length integer into delta, which + # gets added to i. The overflow checking is easier if we increase + # i as we go, then subtract off its starting value at the end to + # obtain delta. + + for {set oldi $i; set w 1; set k $base} 1 {incr in} { + if {[set ch [string index $post $in]] eq ""} { + throw {PUNYCODE BAD_INPUT LENGTH} "exceeded input data" + } + if {[string match -nocase {[a-z]} $ch]} { + scan [string toupper $ch] %c digit + incr digit -65 + } elseif {[string match {[0-9]} $ch]} { + set digit [expr {$ch + 26}] + } else { + throw {PUNYCODE BAD_INPUT CHAR} \ + "bad decode character \"$ch\"" + } + incr i [expr {$digit * $w}] + set t [expr {min(max($tmin, $k-$bias), $tmax)}] + if {$digit < $t} { + set bias [adapt [expr {$i-$oldi}] $first [incr out]] + set first 0 + break + } + if {[set w [expr {$w * ($base - $t)}]] > 0x7fffffff} { + throw {PUNYCODE OVERFLOW} \ + "excessively large integer computed in digit decode" + } + incr k $base + } + + # i was supposed to wrap around from out+1 to 0, incrementing n + # each time, so we'll fix that now: + + if {[incr n [expr {$i / $out}]] > 0x7fffffff} { + throw {PUNYCODE OVERFLOW} \ + "excessively large integer computed in character choice" + } elseif {$n > $max_codepoint} { + if {$n >= 0x00d800 && $n < 0x00e000} { + # Bare surrogate?! + throw {PUNYCODE NON_BMP} \ + [format "unsupported character U+%06x" $n] + } + throw {PUNYCODE NON_UNICODE} "bad codepoint $n" + } + set i [expr {$i % $out}] + + # Insert n at position i of the output: + + set output [linsert $output $i [format "%c" $n]] + incr i + } + + return [join $output ""] + } +} + +package provide tcl::idna 1.0 + +# Local variables: +# mode: tcl +# fill-column: 78 +# End: diff --git a/library/cookiejar/pkgIndex.tcl b/library/cookiejar/pkgIndex.tcl new file mode 100644 index 0000000..a8d8742 --- /dev/null +++ b/library/cookiejar/pkgIndex.tcl @@ -0,0 +1,3 @@ +if {![package vsatisfies [package provide Tcl] 8.6-]} {return} +package ifneeded cookiejar 0.1 [list source [file join $dir cookiejar.tcl]] +package ifneeded tcl::idna 1.0 [list source [file join $dir idna.tcl]] diff --git a/library/http/cookiejar.tcl b/library/http/cookiejar.tcl deleted file mode 100644 index 2eae877..0000000 --- a/library/http/cookiejar.tcl +++ /dev/null @@ -1,745 +0,0 @@ -# cookiejar.tcl -- -# -# Implementation of an HTTP cookie storage engine using SQLite. The -# implementation is done as a TclOO class, and includes a punycode -# encoder and decoder (though only the encoder is currently used). -# -# See the file "license.terms" for information on usage and redistribution of -# this file, and for a DISCLAIMER OF ALL WARRANTIES. - -# Dependencies -package require Tcl 8.6 -package require http 2.8.4 -package require sqlite3 -package require tcl::idna 1.0 - -# -# Configuration for the cookiejar package, plus basic support procedures. -# - -# This is the class that we are creating -if {![llength [info commands ::http::cookiejar]]} { - ::oo::class create ::http::cookiejar -} - -namespace eval [info object namespace ::http::cookiejar] { - proc setInt {*var val} { - upvar 1 ${*var} var - if {[catch {incr dummy $val} msg]} { - return -code error $msg - } - set var $val - } - proc setInterval {trigger *var val} { - upvar 1 ${*var} var - if {![string is integer -strict $val] || $val < 1} { - return -code error "expected positive integer but got \"$val\"" - } - set var $val - {*}$trigger - } - proc setBool {*var val} { - upvar 1 ${*var} var - if {[catch {if {$val} {}} msg]} { - return -code error $msg - } - set var [expr {!!$val}] - } - - proc setLog {*var val} { - upvar 1 ${*var} var - set var [::tcl::prefix match -message "log level" \ - {debug info warn error} $val] - } - - # Keep this in sync with pkgIndex.tcl and with the install directories in - # Makefiles - variable version 0.1 - - variable domainlist \ - http://publicsuffix.org/list/effective_tld_names.dat - variable domainfile \ - [file join [file dirname [info script]] effective_tld_names.txt.gz] - # The list is directed to from http://publicsuffix.org/list/ - variable loglevel info - variable vacuumtrigger 200 - variable retainlimit 100 - variable offline false - variable purgeinterval 60000 - variable refreshinterval 10000000 - variable domaincache {} - - # Some support procedures, none particularly useful in general - namespace eval support { - # Set up a logger if the http package isn't actually loaded yet. - if {![llength [info commands ::http::Log]]} { - proc ::http::Log args { - # Do nothing by default... - } - } - - namespace export * - proc locn {secure domain path {key ""}} { - if {$key eq ""} { - format "%s://%s%s" [expr {$secure?"https":"http"}] \ - [::tcl::idna encode $domain] $path - } else { - format "%s://%s%s?%s" \ - [expr {$secure?"https":"http"}] [::tcl::idna encode $domain] \ - $path $key - } - } - proc splitDomain domain { - set pieces [split $domain "."] - for {set i [llength $pieces]} {[incr i -1] >= 0} {} { - lappend result [join [lrange $pieces $i end] "."] - } - return $result - } - proc splitPath path { - set pieces [split [string trimleft $path "/"] "/"] - for {set j -1} {$j < [llength $pieces]} {incr j} { - lappend result /[join [lrange $pieces 0 $j] "/"] - } - return $result - } - proc isoNow {} { - set ms [clock milliseconds] - set ts [expr {$ms / 1000}] - set ms [format %03d [expr {$ms % 1000}]] - clock format $ts -format "%Y%m%dT%H%M%S.${ms}Z" -gmt 1 - } - proc log {level msg args} { - namespace upvar [info object namespace ::http::cookiejar] \ - loglevel loglevel - set who [uplevel 1 self class] - set mth [uplevel 1 self method] - set map {debug 0 info 1 warn 2 error 3} - if {[string map $map $level] >= [string map $map $loglevel]} { - set msg [format $msg {*}$args] - set LVL [string toupper $level] - ::http::Log "[isoNow] $LVL $who $mth - $msg" - } - } - } -} - -# Now we have enough information to provide the package. -package provide cookiejar \ - [set [info object namespace ::http::cookiejar]::version] - -# The implementation of the cookiejar package -::oo::define ::http::cookiejar { - self { - method configure {{optionName "\u0000\u0000"} {optionValue "\u0000\u0000"}} { - set tbl { - -domainfile {domainfile set} - -domainlist {domainlist set} - -domainrefresh {refreshinterval setInterval} - -loglevel {loglevel setLog} - -offline {offline setBool} - -purgeold {purgeinterval setInterval} - -retain {retainlimit setInt} - -vacuumtrigger {vacuumtrigger setInt} - } - dict lappend tbl -domainrefresh [namespace code { - my IntervalTrigger PostponeRefresh - }] - dict lappend tbl -purgeold [namespace code { - my IntervalTrigger PostponePurge - }] - if {$optionName eq "\u0000\u0000"} { - return [dict keys $tbl] - } - set opt [::tcl::prefix match -message "option" \ - [dict keys $tbl] $optionName] - set setter [lassign [dict get $tbl $opt] varname] - namespace upvar [namespace current] $varname var - if {$optionValue ne "\u0000\u0000"} { - {*}$setter var $optionValue - } - return $var - } - - method IntervalTrigger {method} { - # TODO: handle subclassing - foreach obj [info class instances [self]] { - [info object namespace $obj]::my $method - } - } - } - - variable purgeTimer deletions refreshTimer - constructor {{path ""}} { - namespace import [info object namespace [self class]]::support::* - - if {$path eq ""} { - sqlite3 [namespace current]::db :memory: - set storeorigin "constructed cookie store in memory" - } else { - sqlite3 [namespace current]::db $path - db timeout 500 - set storeorigin "loaded cookie store from $path" - } - - set deletions 0 - db transaction { - db eval { - --;# Store the persistent cookies in this table. - --;# Deletion policy: once they expire, or if explicitly - --;# killed. - CREATE TABLE IF NOT EXISTS persistentCookies ( - id INTEGER PRIMARY KEY, - secure INTEGER NOT NULL, - domain TEXT NOT NULL COLLATE NOCASE, - path TEXT NOT NULL, - key TEXT NOT NULL, - value TEXT NOT NULL, - originonly INTEGER NOT NULL, - expiry INTEGER NOT NULL, - lastuse INTEGER NOT NULL, - creation INTEGER NOT NULL); - CREATE UNIQUE INDEX IF NOT EXISTS persistentUnique - ON persistentCookies (domain, path, key); - CREATE INDEX IF NOT EXISTS persistentLookup - ON persistentCookies (domain, path); - - --;# Store the session cookies in this table. - --;# Deletion policy: at cookiejar instance deletion, if - --;# explicitly killed, or if the number of session cookies is - --;# too large and the cookie has not been used recently. - CREATE TEMP TABLE sessionCookies ( - id INTEGER PRIMARY KEY, - secure INTEGER NOT NULL, - domain TEXT NOT NULL COLLATE NOCASE, - path TEXT NOT NULL, - key TEXT NOT NULL, - originonly INTEGER NOT NULL, - value TEXT NOT NULL, - lastuse INTEGER NOT NULL, - creation INTEGER NOT NULL); - CREATE UNIQUE INDEX sessionUnique - ON sessionCookies (domain, path, key); - CREATE INDEX sessionLookup ON sessionCookies (domain, path); - - --;# View to allow for simple looking up of a cookie. - --;# Deletion policy: NOT SUPPORTED via this view. - CREATE TEMP VIEW cookies AS - SELECT id, domain, ( - CASE originonly WHEN 1 THEN path ELSE '.' || path END - ) AS path, key, value, secure, 1 AS persistent - FROM persistentCookies - UNION - SELECT id, domain, ( - CASE originonly WHEN 1 THEN path ELSE '.' || path END - ) AS path, key, value, secure, 0 AS persistent - FROM sessionCookies; - - --;# Encoded domain permission policy; if forbidden is 1, no - --;# cookie may be ever set for the domain, and if forbidden - --;# is 0, cookies *may* be created for the domain (overriding - --;# the forbiddenSuper table). - --;# Deletion policy: normally not modified. - CREATE TABLE IF NOT EXISTS domains ( - domain TEXT PRIMARY KEY NOT NULL, - forbidden INTEGER NOT NULL); - - --;# Domains that may not have a cookie defined for direct - --;# child domains of them. - --;# Deletion policy: normally not modified. - CREATE TABLE IF NOT EXISTS forbiddenSuper ( - domain TEXT PRIMARY KEY); - - --;# When we last retrieved the domain list. - CREATE TABLE IF NOT EXISTS domainCacheMetadata ( - id INTEGER PRIMARY KEY, - retrievalDate INTEGER, - installDate INTEGER); - } - - set cookieCount "no" - db eval { - SELECT COUNT(*) AS cookieCount FROM persistentCookies - } - log info "%s with %s entries" $storeorigin $cookieCount - - my PostponePurge - - if {$path ne ""} { - if {[db exists {SELECT 1 FROM domains}]} { - my RefreshDomains - } else { - my InitDomainList - my PostponeRefresh - } - } else { - set data [my GetDomainListOffline metadata] - my InstallDomainData $data $metadata - my PostponeRefresh - } - } - } - - method PostponePurge {} { - namespace upvar [info object namespace [self class]] \ - purgeinterval interval - catch {after cancel $purgeTimer} - set purgeTimer [after $interval [namespace code {my PurgeCookies}]] - } - - method PostponeRefresh {} { - namespace upvar [info object namespace [self class]] \ - refreshinterval interval - catch {after cancel $refreshTimer} - set refreshTimer [after $interval [namespace code {my RefreshDomains}]] - } - - method RefreshDomains {} { - # TODO: domain list refresh policy - my PostponeRefresh - } - - method HttpGet {url {timeout 0} {maxRedirects 5}} { - for {set r 0} {$r < $maxRedirects} {incr r} { - set tok [::http::geturl $url -timeout $timeout] - try { - if {[::http::status $tok] eq "timeout"} { - return -code error "connection timed out" - } elseif {[::http::ncode $tok] == 200} { - return [::http::data $tok] - } elseif {[::http::ncode $tok] >= 400} { - return -code error [::http::error $tok] - } elseif {[dict exists [::http::meta $tok] Location]} { - set url [dict get [::http::meta $tok] Location] - continue - } - return -code error \ - "unexpected state: [::http::code $tok]" - } finally { - ::http::cleanup $tok - } - } - return -code error "too many redirects" - } - method GetDomainListOnline {metaVar} { - upvar 1 $metaVar meta - namespace upvar [info object namespace [self class]] \ - domainlist url domaincache cache - lassign $cache when data - if {$when > [clock seconds] - 3600} { - log debug "using cached value created at %s" \ - [clock format $when -format {%Y%m%dT%H%M%SZ} -gmt 1] - dict set meta retrievalDate $when - return $data - } - log debug "loading domain list from %s" $url - try { - set when [clock seconds] - set data [my HttpGet $url] - set cache [list $when $data] - # TODO: Should we use the Last-Modified header instead? - dict set meta retrievalDate $when - return $data - } on error msg { - log error "failed to fetch list of forbidden cookie domains from %s: %s" \ - $url $msg - return {} - } - } - method GetDomainListOffline {metaVar} { - upvar 1 $metaVar meta - namespace upvar [info object namespace [self class]] \ - domainfile filename - log debug "loading domain list from %s" $filename - try { - set f [open $filename] - try { - if {[string match *.gz $filename]} { - zlib push gunzip $f - } - fconfigure $f -encoding utf-8 - dict set meta retrievalDate [file mtime $filename] - return [read $f] - } finally { - close $f - } - } on error {msg opt} { - log error "failed to read list of forbidden cookie domains from %s: %s" \ - $filename $msg - return -options $opt $msg - } - } - method InitDomainList {} { - namespace upvar [info object namespace [self class]] \ - offline offline - if {!$offline} { - try { - set data [my GetDomainListOnline metadata] - if {[string length $data]} { - my InstallDomainData $data $metadata - return - } - } on error {} { - log warn "attempting to fall back to built in version" - } - } - set data [my GetDomainListOffline metadata] - my InstallDomainData $data $metadata - } - - method InstallDomainData {data meta} { - set n [db total_changes] - db transaction { - foreach line [split $data "\n"] { - if {[string trim $line] eq ""} { - continue - } elseif {[string match //* $line]} { - continue - } elseif {[string match !* $line]} { - set line [string range $line 1 end] - set idna [string tolower [::tcl::idna encode $line]] - set utf [::tcl::idna decode [string tolower $line]] - db eval { - INSERT OR REPLACE INTO domains (domain, forbidden) - VALUES ($utf, 0); - } - if {$idna ne $utf} { - db eval { - INSERT OR REPLACE INTO domains (domain, forbidden) - VALUES ($idna, 0); - } - } - } else { - if {[string match {\*.*} $line]} { - set line [string range $line 2 end] - set idna [string tolower [::tcl::idna encode $line]] - set utf [::tcl::idna decode [string tolower $line]] - db eval { - INSERT OR REPLACE INTO forbiddenSuper (domain) - VALUES ($utf); - } - if {$idna ne $utf} { - db eval { - INSERT OR REPLACE INTO forbiddenSuper (domain) - VALUES ($idna); - } - } - } else { - set idna [string tolower [::tcl::idna encode $line]] - set utf [::tcl::idna decode [string tolower $line]] - } - db eval { - INSERT OR REPLACE INTO domains (domain, forbidden) - VALUES ($utf, 1); - } - if {$idna ne $utf} { - db eval { - INSERT OR REPLACE INTO domains (domain, forbidden) - VALUES ($idna, 1); - } - } - } - if {$utf ne [::tcl::idna decode [string tolower $idna]]} { - log warn "mismatch in IDNA handling for %s (%d, %s, %s)" \ - $idna $line $utf [::tcl::idna decode $idna] - } - } - - dict with meta { - set installDate [clock seconds] - db eval { - INSERT OR REPLACE INTO domainCacheMetadata - (id, retrievalDate, installDate) - VALUES (1, $retrievalDate, $installDate); - } - } - } - set n [expr {[db total_changes] - $n}] - log info "constructed domain info with %d entries" $n - } - - # This forces the rebuild of the domain data, loading it from - method forceLoadDomainData {} { - db transaction { - db eval { - DELETE FROM domains; - DELETE FROM forbiddenSuper; - INSERT OR REPLACE INTO domainCacheMetadata - (id, retrievalDate, installDate) - VALUES (1, -1, -1); - } - my InitDomainList - } - } - - destructor { - catch { - after cancel $purgeTimer - } - catch { - after cancel $refreshTimer - } - catch { - db close - } - return - } - - method GetCookiesForHostAndPath {listVar secure host path fullhost} { - upvar 1 $listVar result - log debug "check for cookies for %s" [locn $secure $host $path] - set exact [expr {$host eq $fullhost}] - db eval { - SELECT key, value FROM persistentCookies - WHERE domain = $host AND path = $path AND secure <= $secure - AND (NOT originonly OR domain = $fullhost) - AND originonly = $exact - } { - lappend result $key $value - db eval { - UPDATE persistentCookies SET lastuse = $now WHERE id = $id - } - } - set now [clock seconds] - db eval { - SELECT id, key, value FROM sessionCookies - WHERE domain = $host AND path = $path AND secure <= $secure - AND (NOT originonly OR domain = $fullhost) - AND originonly = $exact - } { - lappend result $key $value - db eval { - UPDATE sessionCookies SET lastuse = $now WHERE id = $id - } - } - } - - method getCookies {proto host path} { - set result {} - set paths [splitPath $path] - if {[regexp {[^0-9.]} $host]} { - set domains [splitDomain [string tolower [::tcl::idna encode $host]]] - } else { - # Ugh, it's a numeric domain! Restrict it to just itself... - set domains [list $host] - } - set secure [string equal -nocase $proto "https"] - # Open question: how to move these manipulations into the database - # engine (if that's where they *should* be). - # - # Suggestion from kbk: - #LENGTH(theColumn) <= LENGTH($queryStr) AND - #SUBSTR(theColumn, LENGTH($queryStr) LENGTH(theColumn)+1) = $queryStr - # - # However, we instead do most of the work in Tcl because that lets us - # do the splitting exactly right, and it's far easier to work with - # strings in Tcl than in SQL. - db transaction { - foreach domain $domains { - foreach p $paths { - my GetCookiesForHostAndPath result $secure $domain $p $host - } - } - return $result - } - } - - method BadDomain options { - if {![dict exists $options domain]} { - log error "no domain present in options" - return 0 - } - dict with options {} - if {$domain ne $origin} { - log debug "cookie domain varies from origin (%s, %s)" \ - $domain $origin - if {[string match .* $domain]} { - set dotd $domain - } else { - set dotd .$domain - } - if {![string equal -length [string length $dotd] \ - [string reverse $dotd] [string reverse $origin]]} { - log warn "bad cookie: domain not suffix of origin" - return 1 - } - } - if {![regexp {[^0-9.]} $domain]} { - if {$domain eq $origin} { - # May set for itself - return 0 - } - log warn "bad cookie: for a numeric address" - return 1 - } - db eval { - SELECT forbidden FROM domains WHERE domain = $domain - } { - if {$forbidden} { - log warn "bad cookie: for a forbidden address" - } - return $forbidden - } - if {[regexp {^[^.]+\.(.+)$} $domain -> super] && [db exists { - SELECT 1 FROM forbiddenSuper WHERE domain = $super - }]} then { - log warn "bad cookie: for a forbidden address" - return 1 - } - return 0 - } - - # A defined extension point to allow users to easily impose extra policies - # on whether to accept cookies from a particular domain and path. - method policyAllow {operation domain path} { - return true - } - - method storeCookie {options} { - db transaction { - if {[my BadDomain $options]} { - return - } - set now [clock seconds] - set persistent [dict exists $options expires] - dict with options {} - if {!$persistent} { - if {![my policyAllow session $domain $path]} { - log warn "bad cookie: $domain prohibited by user policy" - return - } - db eval { - INSERT OR REPLACE INTO sessionCookies ( - secure, domain, path, key, value, originonly, creation, - lastuse) - VALUES ($secure, $domain, $path, $key, $value, $hostonly, - $now, $now); - DELETE FROM persistentCookies - WHERE domain = $domain AND path = $path AND key = $key - AND secure <= $secure AND originonly = $hostonly - } - incr deletions [db changes] - log debug "defined session cookie for %s" \ - [locn $secure $domain $path $key] - } elseif {$expires < $now} { - if {![my policyAllow delete $domain $path]} { - log warn "bad cookie: $domain prohibited by user policy" - return - } - db eval { - DELETE FROM persistentCookies - WHERE domain = $domain AND path = $path AND key = $key - AND secure <= $secure AND originonly = $hostonly - } - set del [db changes] - db eval { - DELETE FROM sessionCookies - WHERE domain = $domain AND path = $path AND key = $key - AND secure <= $secure AND originonly = $hostonly - } - incr deletions [incr del [db changes]] - log debug "deleted %d cookies for %s" \ - $del [locn $secure $domain $path $key] - } else { - if {![my policyAllow set $domain $path]} { - log warn "bad cookie: $domain prohibited by user policy" - return - } - db eval { - INSERT OR REPLACE INTO persistentCookies ( - secure, domain, path, key, value, originonly, expiry, - creation, lastuse) - VALUES ($secure, $domain, $path, $key, $value, $hostonly, - $expires, $now, $now); - DELETE FROM sessionCookies - WHERE domain = $domain AND path = $path AND key = $key - AND secure <= $secure AND originonly = $hostonly - } - incr deletions [db changes] - log debug "defined persistent cookie for %s, expires at %s" \ - [locn $secure $domain $path $key] \ - [clock format $expires] - } - } - } - - method PurgeCookies {} { - namespace upvar [info object namespace [self class]] \ - vacuumtrigger trigger retainlimit retain - my PostponePurge - set now [clock seconds] - log debug "purging cookies that expired before %s" [clock format $now] - db transaction { - db eval { - DELETE FROM persistentCookies WHERE expiry < $now - } - incr deletions [db changes] - db eval { - DELETE FROM persistentCookies WHERE id IN ( - SELECT id FROM persistentCookies ORDER BY lastuse ASC - LIMIT -1 OFFSET $retain) - } - incr deletions [db changes] - db eval { - DELETE FROM sessionCookies WHERE id IN ( - SELECT id FROM sessionCookies ORDER BY lastuse - LIMIT -1 OFFSET $retain) - } - incr deletions [db changes] - } - - # Once we've deleted a fair bit, vacuum the database. Must be done - # outside a transaction. - if {$deletions > $trigger} { - set deletions 0 - log debug "vacuuming cookie database" - catch { - db eval { - VACUUM - } - } - } - } - - forward Database db - - method lookup {{host ""} {key ""}} { - set host [string tolower [::tcl::idna encode $host]] - db transaction { - if {$host eq ""} { - set result {} - db eval { - SELECT DISTINCT domain FROM cookies - ORDER BY domain - } { - lappend result [::tcl::idna decode [string tolower $domain]] - } - return $result - } elseif {$key eq ""} { - set result {} - db eval { - SELECT DISTINCT key FROM cookies - WHERE domain = $host - ORDER BY key - } { - lappend result $key - } - return $result - } else { - db eval { - SELECT value FROM cookies - WHERE domain = $host AND key = $key - LIMIT 1 - } { - return $value - } - return -code error "no such key for that host" - } - } - } -} - -# Local variables: -# mode: tcl -# fill-column: 78 -# End: diff --git a/library/http/effective_tld_names.txt.gz b/library/http/effective_tld_names.txt.gz deleted file mode 100644 index 13e08bb..0000000 Binary files a/library/http/effective_tld_names.txt.gz and /dev/null differ diff --git a/library/http/idna.tcl b/library/http/idna.tcl deleted file mode 100644 index 2a7d289..0000000 --- a/library/http/idna.tcl +++ /dev/null @@ -1,292 +0,0 @@ -# cookiejar.tcl -- -# -# Implementation of IDNA (Internationalized Domain Names for -# Applications) encoding/decoding system, built on a punycode engine -# developed directly from the code in RFC 3492, Appendix C (with -# substantial modifications). -# -# This implementation includes code from that RFC, translated to Tcl; the -# other parts are: -# Copyright (c) 2014 Donal K. Fellows -# -# See the file "license.terms" for information on usage and redistribution of -# this file, and for a DISCLAIMER OF ALL WARRANTIES. - -namespace eval ::tcl::idna { - namespace ensemble create -command puny -map { - encode punyencode - decode punydecode - } - namespace ensemble create -command ::tcl::idna -map { - encode IDNAencode - decode IDNAdecode - puny puny - version {::apply {{} {package present tcl::idna} ::}} - } - - proc IDNAencode hostname { - set parts {} - # Split term from RFC 3490, Sec 3.1 - foreach part [split $hostname "\u002E\u3002\uFF0E\uFF61"] { - if {[regexp {[^-A-Za-z0-9]} $part]} { - if {[regexp {[^-A-Za-z0-9\u00a1-\uffff]} $part ch]} { - scan $ch %c c - if {$ch < "!" || $ch > "~"} { - set ch [format "\\u%04x" $c] - } - throw [list IDNA INVALID_NAME_CHARACTER $ch] \ - "bad character \"$ch\" in DNS name" - } - set part xn--[punyencode $part] - # Length restriction from RFC 5890, Sec 2.3.1 - if {[string length $part] > 63} { - throw [list IDNA OVERLONG_PART $part] \ - "hostname part too long" - } - } - lappend parts $part - } - return [join $parts .] - } - proc IDNAdecode hostname { - set parts {} - # Split term from RFC 3490, Sec 3.1 - foreach part [split $hostname "\u002E\u3002\uFF0E\uFF61"] { - if {[string match -nocase "xn--*" $part]} { - set part [punydecode [string range $part 4 end]] - } - lappend parts $part - } - return [join $parts .] - } - - variable digits [split "abcdefghijklmnopqrstuvwxyz0123456789" ""] - # Bootstring parameters for Punycode - variable base 36 - variable tmin 1 - variable tmax 26 - variable skew 38 - variable damp 700 - variable initial_bias 72 - variable initial_n 0x80 - - variable max_codepoint 0x10FFFF - - proc adapt {delta first numchars} { - variable base - variable tmin - variable tmax - variable damp - variable skew - - set delta [expr {$delta / ($first ? $damp : 2)}] - incr delta [expr {$delta / $numchars}] - set k 0 - while {$delta > ($base - $tmin) * $tmax / 2} { - set delta [expr {$delta / ($base-$tmin)}] - incr k $base - } - return [expr {$k + ($base-$tmin+1) * $delta / ($delta+$skew)}] - } - - # Main punycode encoding function - proc punyencode {string {case ""}} { - variable digits - variable tmin - variable tmax - variable base - variable initial_n - variable initial_bias - - if {![string is boolean $case]} { - return -code error "\"$case\" must be boolean" - } - - set in {} - foreach char [set string [split $string ""]] { - scan $char "%c" ch - lappend in $ch - } - set output {} - - # Initialize the state: - set n $initial_n - set delta 0 - set bias $initial_bias - - # Handle the basic code points: - foreach ch $string { - if {$ch < "\u0080"} { - if {$case eq ""} { - append output $ch - } elseif {[string is true $case]} { - append output [string toupper $ch] - } elseif {[string is false $case]} { - append output [string tolower $ch] - } - } - } - - set b [string length $output] - - # h is the number of code points that have been handled, b is the - # number of basic code points. - - if {$b > 0} { - append output "-" - } - - # Main encoding loop: - - for {set h $b} {$h < [llength $in]} {incr delta; incr n} { - # All non-basic code points < n have been handled already. Find - # the next larger one: - - set m inf - foreach ch $in { - if {$ch >= $n && $ch < $m} { - set m $ch - } - } - - # Increase delta enough to advance the decoder's state to - # , but guard against overflow: - - if {$m-$n > (0xffffffff-$delta)/($h+1)} { - throw {PUNYCODE OVERFLOW} "overflow in delta computation" - } - incr delta [expr {($m-$n) * ($h+1)}] - set n $m - - foreach ch $in { - if {$ch < $n && ([incr delta] & 0xffffffff) == 0} { - throw {PUNYCODE OVERFLOW} "overflow in delta computation" - } - - if {$ch != $n} { - continue - } - - # Represent delta as a generalized variable-length integer: - - for {set q $delta; set k $base} true {incr k $base} { - set t [expr {min(max($k-$bias, $tmin), $tmax)}] - if {$q < $t} { - break - } - append output \ - [lindex $digits [expr {$t + ($q-$t)%($base-$t)}]] - set q [expr {($q-$t) / ($base-$t)}] - } - - append output [lindex $digits $q] - set bias [adapt $delta [expr {$h==$b}] [expr {$h+1}]] - set delta 0 - incr h - } - } - - return $output - } - - # Main punycode decode function - proc punydecode {string {case ""}} { - variable tmin - variable tmax - variable base - variable initial_n - variable initial_bias - variable max_codepoint - - if {![string is boolean $case]} { - return -code error "\"$case\" must be boolean" - } - - # Initialize the state: - - set n $initial_n - set i 0 - set first 1 - set bias $initial_bias - - # Split the string into the "real" ASCII characters and the ones to - # feed into the main decoder. Note that we don't need to check the - # result of [regexp] because that RE will technically match any string - # at all. - - regexp {^(?:(.*)-)?([^-]*)$} $string -> pre post - if {[string is true -strict $case]} { - set pre [string toupper $pre] - } elseif {[string is false -strict $case]} { - set pre [string tolower $pre] - } - set output [split $pre ""] - set out [llength $output] - - # Main decoding loop: - - for {set in 0} {$in < [string length $post]} {incr in} { - # Decode a generalized variable-length integer into delta, which - # gets added to i. The overflow checking is easier if we increase - # i as we go, then subtract off its starting value at the end to - # obtain delta. - - for {set oldi $i; set w 1; set k $base} 1 {incr in} { - if {[set ch [string index $post $in]] eq ""} { - throw {PUNYCODE BAD_INPUT LENGTH} "exceeded input data" - } - if {[string match -nocase {[a-z]} $ch]} { - scan [string toupper $ch] %c digit - incr digit -65 - } elseif {[string match {[0-9]} $ch]} { - set digit [expr {$ch + 26}] - } else { - throw {PUNYCODE BAD_INPUT CHAR} \ - "bad decode character \"$ch\"" - } - incr i [expr {$digit * $w}] - set t [expr {min(max($tmin, $k-$bias), $tmax)}] - if {$digit < $t} { - set bias [adapt [expr {$i-$oldi}] $first [incr out]] - set first 0 - break - } - if {[set w [expr {$w * ($base - $t)}]] > 0x7fffffff} { - throw {PUNYCODE OVERFLOW} \ - "excessively large integer computed in digit decode" - } - incr k $base - } - - # i was supposed to wrap around from out+1 to 0, incrementing n - # each time, so we'll fix that now: - - if {[incr n [expr {$i / $out}]] > 0x7fffffff} { - throw {PUNYCODE OVERFLOW} \ - "excessively large integer computed in character choice" - } elseif {$n > $max_codepoint} { - if {$n >= 0x00d800 && $n < 0x00e000} { - # Bare surrogate?! - throw {PUNYCODE NON_BMP} \ - [format "unsupported character U+%06x" $n] - } - throw {PUNYCODE NON_UNICODE} "bad codepoint $n" - } - set i [expr {$i % $out}] - - # Insert n at position i of the output: - - set output [linsert $output $i [format "%c" $n]] - incr i - } - - return [join $output ""] - } -} - -package provide tcl::idna 1.0 - -# Local variables: -# mode: tcl -# fill-column: 78 -# End: diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index e126083..f9f1176 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -1,4 +1,2 @@ if {![package vsatisfies [package provide Tcl] 8.6-]} {return} package ifneeded http 2.9.1 [list tclPkgSetup $dir http 2.9.1 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] -package ifneeded cookiejar 0.1 [list source [file join $dir cookiejar.tcl]] -package ifneeded tcl::idna 1.0 [list source [file join $dir idna.tcl]] diff --git a/unix/Makefile.in b/unix/Makefile.in index 8d74cc3..2ba9f5f 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1025,6 +1025,10 @@ install-libraries: libraries $(UNIX_DIR)/tclAppInit.c @LDAIX_SRC@ @DTRACE_SRC@ ; do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \ done + @echo "Installing package cookiejar 0.1 files to $(SCRIPT_INSTALL_DIR)/cookiejar0.1/" + @for i in $(TOP_DIR)/library/cookiejar/*.{tcl,txt.gz}; do \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/cookiejar0.1; \ + done @echo "Installing package http 2.9.1 as a Tcl Module" @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl \ "$(MODULE_INSTALL_DIR)"/tcl8/8.6/http-2.9.1.tm @@ -2220,7 +2224,7 @@ DISTROOT = /tmp/dist DISTNAME = tcl${VERSION}${PATCH_LEVEL} ZIPNAME = tcl${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}-src.zip DISTDIR = $(DISTROOT)/$(DISTNAME) -BUILTIN_PACKAGE_LIST = http opt msgcat reg dde tcltest platform +BUILTIN_PACKAGE_LIST = cookiejar http opt msgcat reg dde tcltest platform $(UNIX_DIR)/configure: $(UNIX_DIR)/configure.ac $(UNIX_DIR)/tcl.m4 \ $(UNIX_DIR)/aclocal.m4 @@ -2262,6 +2266,7 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tclConfig.h.in $(UNIX_DIR)/tcl.pc.in \ mkdir $(DISTDIR)/library/$$i;\ cp -p $(TOP_DIR)/library/$$i/*.tcl $(DISTDIR)/library/$$i; \ done + cp -p $(TOP_DIR)/library/cookiejar/*.txt.gz $(DISTDIR)/library/cookiejar @mkdir $(DISTDIR)/library/encoding cp -p $(TOP_DIR)/library/encoding/*.enc $(DISTDIR)/library/encoding @mkdir $(DISTDIR)/library/msgs -- cgit v0.12 From d8a1ef082777292ede109a0ed919d8174d6929dd Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 26 Nov 2019 21:35:52 +0000 Subject: Fix installation of cookiejar on UNIX, and add same pieces to windows as well. Also modify manifext.txt accordingly, for the zipfile vfs. --- library/manifest.txt | 2 ++ unix/Makefile.in | 2 +- win/Makefile.in | 7 ++++++- win/makefile.vc | 13 +++++++++++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/library/manifest.txt b/library/manifest.txt index 16092b8..6bbbb51 100644 --- a/library/manifest.txt +++ b/library/manifest.txt @@ -8,6 +8,8 @@ apply {{dir} { 0 http 2.9.1 {http http.tcl} 1 msgcat 1.7.0 {msgcat msgcat.tcl} 1 opt 0.4.7 {opt optparse.tcl} + 0 cookiejar 0.1 {cookiejar cookiejar.tcl} + 0 tcl::idna 1.0 {cookiejar idna.tcl} 0 platform 1.0.14 {platform platform.tcl} 0 platform::shell 1.1.4 {platform shell.tcl} 1 tcltest 2.5.1 {tcltest tcltest.tcl} diff --git a/unix/Makefile.in b/unix/Makefile.in index 2ba9f5f..1d0727d 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1014,7 +1014,7 @@ install-libraries: libraries $(INSTALL_DATA_DIR) "$$i"; \ fi; \ done - @for i in opt0.4 encoding ../tcl8 ../tcl8/8.4 ../tcl8/8.4/platform ../tcl8/8.5 ../tcl8/8.6 ../tcl8/8.7; do \ + @for i in opt0.4 cookiejar0.1 encoding ../tcl8 ../tcl8/8.4 ../tcl8/8.4/platform ../tcl8/8.5 ../tcl8/8.6 ../tcl8/8.7; do \ if [ ! -d "$(SCRIPT_INSTALL_DIR)"/$$i ] ; then \ echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \ $(INSTALL_DATA_DIR) "$(SCRIPT_INSTALL_DIR)"/$$i; \ diff --git a/win/Makefile.in b/win/Makefile.in index 1c2057a..51ac71c 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -850,7 +850,7 @@ install-libraries: libraries install-tzdata install-msgs else true; \ fi; \ done; - @for i in opt0.4 encoding ../tcl8 ../tcl8/8.4 ../tcl8/8.4/platform ../tcl8/8.5 ../tcl8/8.6 ../tcl8/8.7; \ + @for i in opt0.4 cookiejar0.1 encoding ../tcl8 ../tcl8/8.4 ../tcl8/8.4/platform ../tcl8/8.5 ../tcl8/8.6 ../tcl8/8.7; \ do \ if [ ! -d $(SCRIPT_INSTALL_DIR)/$$i ] ; then \ echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \ @@ -863,6 +863,11 @@ install-libraries: libraries install-tzdata install-msgs do \ $(COPY) "$$i" "$(SCRIPT_INSTALL_DIR)"; \ done; + @echo "Installing package cookiejar 0.1 files to $(SCRIPT_INSTALL_DIR)/cookiejar0.1/" + @for j in $(ROOT_DIR)/library/cookiejar/*.{tcl,txt.gz}; do \ + do \ + $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/cookiejar0.1"; \ + done; @echo "Installing package http 2.9.1 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.6/http-2.9.1.tm; @echo "Installing library opt0.4 directory"; diff --git a/win/makefile.vc b/win/makefile.vc index 44597a3..b943ed8 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -881,6 +881,10 @@ install-binaries: install-libraries: tclConfig tcl-nmake install-msgs install-tzdata @if not exist "$(SCRIPT_INSTALL_DIR)" \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)" + @if not exist "$(SCRIPT_INSTALL_DIR)\opt0.4" \ + $(MKDIR) "$(SCRIPT_INSTALL_DIR)\opt0.4" + @if not exist "$(SCRIPT_INSTALL_DIR)\cookiejar0.1" \ + $(MKDIR) "$(SCRIPT_INSTALL_DIR)\cookiejar0.1" @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8" \ $(MKDIR) "$(SCRIPT_INSTALL_DIR)\..\tcl8" @if not exist "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.4" \ @@ -920,8 +924,13 @@ install-libraries: tclConfig tcl-nmake install-msgs install-tzdata @$(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" \ + @echo Installing package cookiejar 0.1 files to $(SCRIPT_INSTALL_DIR)/cookiejar0.1/ + @$(CPY) "$(ROOT)\library\cookiejar\*.tcl" \ + "$(SCRIPT_INSTALL_DIR)\cookiejar0.1\" + @$(CPY) "$(ROOT)\library\cookiejar\*.gz" \ + "$(SCRIPT_INSTALL_DIR)\cookiejar0.1\" + @echo Installing package opt0.4 files to $(SCRIPT_INSTALL_DIR)/opt0.4/ + @$(CPY) "$(ROOT)\library\opt0.4\*.tcl" \ "$(SCRIPT_INSTALL_DIR)\opt0.4\" @echo Installing package http $(PKG_HTTP_VER) as a Tcl Module @$(COPY) "$(ROOT)\library\http\http.tcl" \ -- cgit v0.12 From 627fe239a59a6000e68c217f764dd32e9dc3565c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 27 Nov 2019 09:44:17 +0000 Subject: Don't bother paths of 64-bit SDK any more: This was Visual Studio 2008-specific and doesn't work with other Visual Studio versions. --- win/configure | 233 +++++++++++++++++++--------------------------------------- win/tcl.m4 | 28 +------ 2 files changed, 78 insertions(+), 183 deletions(-) diff --git a/win/configure b/win/configure index 7da12da..f0e7554 100755 --- a/win/configure +++ b/win/configure @@ -3175,78 +3175,6 @@ fi # after SC_ENABLE_SHARED checks the configure switches. #-------------------------------------------------------------------- -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - # Step 0: Enable 64 bit support? @@ -3724,29 +3652,15 @@ echo "${ECHO_T}using shared flags" >&6 # users of tclConfig.sh that may build shared or static. DLLSUFFIX="\${DBGX}.dll" - # This is a 2-stage check to make sure we have the 64-bit SDK - # We have to know where the SDK is installed. - # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs if test "$do64bit" != "no" ; then - if test "x${MSSDK}x" = "xx" ; then - MSSDK="C:/Progra~1/Microsoft Platform SDK" - fi - MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` - PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # assume AMD64 as default 64-bit build - PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" - PATH64="${MSSDK}/Bin/Win64" ;; esac - if test ! -d "${PATH64}" ; then - { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK" >&5 -echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK" >&2;} - fi echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 fi @@ -3762,81 +3676,12 @@ echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 esac if test "$do64bit" != "no" ; then - # The space-based-path will work for the Makefile, but will - # not work if AC_TRY_COMPILE is called. TEA has the - # TEA_PATH_NOSPACE to avoid this issue. - # Check if _WIN64 is already recognized, and if so we don't - # need to modify CC. - echo "$as_me:$LINENO: checking whether _WIN64 is declared" >&5 -echo $ECHO_N "checking whether _WIN64 is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl__WIN64+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -#ifndef _WIN64 - char *p = (char *) _WIN64; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_have_decl__WIN64=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_have_decl__WIN64=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl__WIN64" >&5 -echo "${ECHO_T}$ac_cv_have_decl__WIN64" >&6 -if test $ac_cv_have_decl__WIN64 = yes; then - : -else - CC="\"${PATH64}/cl.exe\" -I\"${MSSDK}/Include\" \ - -I\"${MSSDK}/Include/crt\" \ - -I\"${MSSDK}/Include/crt/sys\"" -fi - - RC="\"${MSSDK}/bin/rc.exe\"" + RC="rc" CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" # Do not use -O2 for Win64 - this has proved buggy in code gen. CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}" - lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" - LINKBIN="\"${PATH64}/link.exe\"" + lflags="${lflags} -nologo -MACHINE:${MACHINE}" + LINKBIN="link" # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 LIBS="$LIBS bufferoverflowU.lib" @@ -4293,6 +4138,78 @@ _ACEOF +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + echo "$as_me:$LINENO: checking for intptr_t" >&5 echo $ECHO_N "checking for intptr_t... $ECHO_C" >&6 if test "${ac_cv_type_intptr_t+set}" = set; then diff --git a/win/tcl.m4 b/win/tcl.m4 index 006778c..9703a9a 100644 --- a/win/tcl.m4 +++ b/win/tcl.m4 @@ -795,28 +795,15 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ # users of tclConfig.sh that may build shared or static. DLLSUFFIX="\${DBGX}.dll" - # This is a 2-stage check to make sure we have the 64-bit SDK - # We have to know where the SDK is installed. - # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs if test "$do64bit" != "no" ; then - if test "x${MSSDK}x" = "xx" ; then - MSSDK="C:/Progra~1/Microsoft Platform SDK" - fi - MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` - PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # assume AMD64 as default 64-bit build - PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" - PATH64="${MSSDK}/Bin/Win64" ;; esac - if test ! -d "${PATH64}" ; then - AC_MSG_WARN([Could not find 64-bit $MACHINE SDK]) - fi AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) fi @@ -831,21 +818,12 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ esac if test "$do64bit" != "no" ; then - # The space-based-path will work for the Makefile, but will - # not work if AC_TRY_COMPILE is called. TEA has the - # TEA_PATH_NOSPACE to avoid this issue. - # Check if _WIN64 is already recognized, and if so we don't - # need to modify CC. - AC_CHECK_DECL([_WIN64], [], - [CC="\"${PATH64}/cl.exe\" -I\"${MSSDK}/Include\" \ - -I\"${MSSDK}/Include/crt\" \ - -I\"${MSSDK}/Include/crt/sys\""]) - RC="\"${MSSDK}/bin/rc.exe\"" + RC="rc" CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" # Do not use -O2 for Win64 - this has proved buggy in code gen. CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}" - lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" - LINKBIN="\"${PATH64}/link.exe\"" + lflags="${lflags} -nologo -MACHINE:${MACHINE}" + LINKBIN="link" # Avoid 'unresolved external symbol __security_cookie' errors. # c.f. http://support.microsoft.com/?id=894573 LIBS="$LIBS bufferoverflowU.lib" -- cgit v0.12 From d9f8a230026664cc73add358b6c5985c7700af89 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 27 Nov 2019 11:01:38 +0000 Subject: Proposed Windows installation code for cookiejar package --- win/Makefile.in | 9 +++++++++ win/makefile.vc | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/win/Makefile.in b/win/Makefile.in index 51ac71c..327bea2 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -868,6 +868,15 @@ install-libraries: libraries install-tzdata install-msgs do \ $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/cookiejar0.1"; \ done; + @echo "Installing package cookiejar 0.1" + @for j in $(ROOT_DIR)/library/cookiejar/*.tcl; \ + do \ + $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)"/cookiejar0.1; \ + done + @for j in $(ROOT_DIR)/library/cookiejar/*.txt.gz; \ + do \ + $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)"/cookiejar0.1; \ + done @echo "Installing package http 2.9.1 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.6/http-2.9.1.tm; @echo "Installing library opt0.4 directory"; diff --git a/win/makefile.vc b/win/makefile.vc index b943ed8..12d8751 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -154,6 +154,9 @@ VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) !if [echo PKG_HTTP_VER = \>> versions.vc] \ && [nmakehlp -V ..\library\http\pkgIndex.tcl http >> versions.vc] !endif +!if [echo PKG_COOKIEJAR_VER = \>> versions.vc] \ + && [nmakehlp -V ..\library\cookiejar\pkgIndex.tcl cookiejar >> versions.vc] +!endif !if [echo PKG_TCLTEST_VER = \>> versions.vc] \ && [nmakehlp -V ..\library\tcltest\pkgIndex.tcl tcltest >> versions.vc] !endif @@ -932,6 +935,11 @@ install-libraries: tclConfig tcl-nmake install-msgs install-tzdata @echo Installing package opt0.4 files to $(SCRIPT_INSTALL_DIR)/opt0.4/ @$(CPY) "$(ROOT)\library\opt0.4\*.tcl" \ "$(SCRIPT_INSTALL_DIR)\opt0.4\" + @echo Installing package cookiejar $(PKG_COOKIEJAR_VER) directory + @$(CPY) "$(ROOT)\library\cookiejar\*.tcl" \ + "$(SCRIPT_INSTALL_DIR)\cookiejar$(PKG_COOKIEJAR_VER)\" + @$(CPY) "$(ROOT)\library\cookiejar\*.txt.gz" \ + "$(SCRIPT_INSTALL_DIR)\cookiejar$(PKG_COOKIEJAR_VER)\" @echo Installing package http $(PKG_HTTP_VER) as a Tcl Module @$(COPY) "$(ROOT)\library\http\http.tcl" \ "$(SCRIPT_INSTALL_DIR)\..\tcl8\8.6\http-$(PKG_HTTP_VER).tm" -- cgit v0.12 From f5464908a6b876ab669efb8c20b28c604bed3ffa Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 27 Nov 2019 12:14:57 +0000 Subject: Move check for stdbool.h from SC_MISSING_POSIX_HEADERS to SC_CONFIG_CFLAGS, since it's not POSIX. --- unix/configure | 17 +++++++++-------- unix/tcl.m4 | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/unix/configure b/unix/configure index 5152965..aa1c1b4 100755 --- a/unix/configure +++ b/unix/configure @@ -3894,14 +3894,6 @@ $as_echo "#define NO_DLFCN_H 1" >>confdefs.h fi - ac_fn_c_check_header_mongrel "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" -if test "x$ac_cv_header_stdbool_h" = xyes; then : - -$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h - -fi - - # OS/390 lacks sys/param.h (and doesn't need it, by chance). for ac_header in sys/param.h @@ -6581,6 +6573,15 @@ $as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h fi + ac_fn_c_check_header_mongrel "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" +if test "x$ac_cv_header_stdbool_h" = xyes; then : + +$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h + +fi + + + # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. diff --git a/unix/tcl.m4 b/unix/tcl.m4 index f3e56e1..1ee1617 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1873,6 +1873,8 @@ dnl # preprocessing tests use only CPPFLAGS. [Defined when compiler supports casting to union type.]) fi + AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have ?])],) + # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone # would use TCL_DL_LIBS instead of TCL_LIBS. @@ -1933,7 +1935,6 @@ dnl # preprocessing tests use only CPPFLAGS. # NO_SYS_WAIT_H # NO_DLFCN_H # HAVE_SYS_PARAM_H -# HAVE_STDBOOL_H # HAVE_STRING_H ? # #-------------------------------------------------------------------- @@ -1984,7 +1985,6 @@ closedir(d); AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) - AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have ?])],) # OS/390 lacks sys/param.h (and doesn't need it, by chance). AC_HAVE_HEADERS(sys/param.h) -- cgit v0.12 From 9a80393d63c21d2ba09ca7767dbf810d2e6f96a4 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 27 Nov 2019 14:25:47 +0000 Subject: Minor tweak: Don't include the "dde" and "reg" directory in the zip-file on UNIX --- unix/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/unix/Makefile.in b/unix/Makefile.in index 1d0727d..b3811e3 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -778,6 +778,7 @@ ${TCL_ZIP_FILE}: ${ZIP_INSTALL_OBJS} cp -a $(TOP_DIR)/library/* ${TCL_VFS_PATH}; \ cp -a ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl; \ fi + rm -rf ${TCL_VFS_PATH}/dde ${TCL_VFS_PATH}/reg @find ${TCL_VFS_ROOT} -type d -empty -delete @echo "creating ${TCL_ZIP_FILE} from ${TCL_VFS_PATH}" @(zip=`(realpath '${NATIVE_ZIP}' || readlink -m '${NATIVE_ZIP}' || \ -- cgit v0.12 From 0c50d57d0866b97891c2864bc5d03288f80ff595 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 27 Nov 2019 20:15:50 +0000 Subject: Another minor tweak: No need to include manifest.txt in the vfs zip-file, since it's renamed to pkgIndex.tcl --- unix/Makefile.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index b3811e3..40efe65 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -772,12 +772,11 @@ ${TCL_ZIP_FILE}: ${ZIP_INSTALL_OBJS} @mkdir -p ${TCL_VFS_PATH} @echo "creating ${TCL_VFS_PATH} (prepare compression)" @if \ - ln -s $(TOP_DIR)/library/* ${TCL_VFS_PATH}/ && \ - ln ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl; \ + ln -s $(TOP_DIR)/library/* ${TCL_VFS_PATH}/; \ then : ; else \ cp -a $(TOP_DIR)/library/* ${TCL_VFS_PATH}; \ - cp -a ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl; \ fi + mv ${TCL_VFS_PATH}/manifest.txt ${TCL_VFS_PATH}/pkgIndex.tcl rm -rf ${TCL_VFS_PATH}/dde ${TCL_VFS_PATH}/reg @find ${TCL_VFS_ROOT} -type d -empty -delete @echo "creating ${TCL_ZIP_FILE} from ${TCL_VFS_PATH}" -- cgit v0.12 From 0e57f61edee6a4deb2b8d98b9009eb0f4d2d89e7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 27 Nov 2019 22:20:48 +0000 Subject: (hopefully) fix installation on Windows --- win/makefile.vc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/makefile.vc b/win/makefile.vc index b943ed8..1e05f4d 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -930,7 +930,7 @@ install-libraries: tclConfig tcl-nmake install-msgs install-tzdata @$(CPY) "$(ROOT)\library\cookiejar\*.gz" \ "$(SCRIPT_INSTALL_DIR)\cookiejar0.1\" @echo Installing package opt0.4 files to $(SCRIPT_INSTALL_DIR)/opt0.4/ - @$(CPY) "$(ROOT)\library\opt0.4\*.tcl" \ + @$(CPY) "$(ROOT)\library\opt\*.tcl" \ "$(SCRIPT_INSTALL_DIR)\opt0.4\" @echo Installing package http $(PKG_HTTP_VER) as a Tcl Module @$(COPY) "$(ROOT)\library\http\http.tcl" \ -- cgit v0.12 From d473f1507c154f001a28c74e520d79d0b8edd8e3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 28 Nov 2019 10:54:21 +0000 Subject: Update "opt" from version 0.4.5 to 0.4.7, backported from Tcl 8.7a3. --- library/opt/optparse.tcl | 458 +++++++++++++++++++++++------------------------ library/opt/pkgIndex.tcl | 4 +- tests/opt.test | 22 +-- tests/safe.test | 2 +- 4 files changed, 243 insertions(+), 243 deletions(-) diff --git a/library/opt/optparse.tcl b/library/opt/optparse.tcl index 8caaac4..c8946fd 100644 --- a/library/opt/optparse.tcl +++ b/library/opt/optparse.tcl @@ -8,10 +8,10 @@ # on it. If your code does rely on this package you # may directly incorporate this code into your application. -package require Tcl 8.2 +package require Tcl 8.5- # When this version number changes, update the pkgIndex.tcl file # and the install directory in the Makefiles. -package provide opt 0.4.5 +package provide opt 0.4.7 namespace eval ::tcl { @@ -69,10 +69,10 @@ namespace eval ::tcl { ################### No User serviceable part below ! ############### # Array storing the parsed descriptions - variable OptDesc; - array set OptDesc {}; + variable OptDesc + array set OptDesc {} # Next potentially free key id (numeric) - variable OptDescN 0; + variable OptDescN 0 # Inside algorithm/mechanism description: # (not for the faint hearted ;-) @@ -143,54 +143,54 @@ namespace eval ::tcl { # generate a unused keyid if not given # proc ::tcl::OptKeyRegister {desc {key ""}} { - variable OptDesc; - variable OptDescN; + variable OptDesc + variable OptDescN if {[string equal $key ""]} { # in case a key given to us as a parameter was a number while {[info exists OptDesc($OptDescN)]} {incr OptDescN} - set key $OptDescN; - incr OptDescN; + set key $OptDescN + incr OptDescN } # program counter - set program [list [list "P" 1]]; + set program [list [list "P" 1]] # are we processing flags (which makes a single program step) - set inflags 0; + set inflags 0 - set state {}; + set state {} # flag used to detect that we just have a single (flags set) subprogram. - set empty 1; + set empty 1 foreach item $desc { if {$state == "args"} { # more items after 'args'... - return -code error "'args' special argument must be the last one"; + return -code error "'args' special argument must be the last one" } - set res [OptNormalizeOne $item]; - set state [lindex $res 0]; + set res [OptNormalizeOne $item] + set state [lindex $res 0] if {$inflags} { if {$state == "flags"} { # add to 'subprogram' - lappend flagsprg $res; + lappend flagsprg $res } else { # put in the flags # structure for flag programs items is a list of # {subprgcounter {prg flag 1} {prg flag 2} {...}} - lappend program $flagsprg; + lappend program $flagsprg # put the other regular stuff - lappend program $res; - set inflags 0; - set empty 0; + lappend program $res + set inflags 0 + set empty 0 } } else { if {$state == "flags"} { - set inflags 1; + set inflags 1 # sub program counter + first sub program - set flagsprg [list [list "P" 1] $res]; + set flagsprg [list [list "P" 1] $res] } else { - lappend program $res; - set empty 0; + lappend program $res + set empty 0 } } } @@ -198,32 +198,32 @@ proc ::tcl::OptKeyRegister {desc {key ""}} { if {$empty} { # We just have the subprogram, optimize and remove # unneeded level: - set program $flagsprg; + set program $flagsprg } else { - lappend program $flagsprg; + lappend program $flagsprg } } - set OptDesc($key) $program; + set OptDesc($key) $program - return $key; + return $key } # # Free the storage for that given key # proc ::tcl::OptKeyDelete {key} { - variable OptDesc; - unset OptDesc($key); + variable OptDesc + unset OptDesc($key) } # Get the parsed description stored under the given key. proc OptKeyGetDesc {descKey} { - variable OptDesc; + variable OptDesc if {![info exists OptDesc($descKey)]} { - return -code error "Unknown option description key \"$descKey\""; + return -code error "Unknown option description key \"$descKey\"" } - set OptDesc($descKey); + set OptDesc($descKey) } # Parse entry point for ppl who don't want to register with a key, @@ -232,10 +232,10 @@ proc ::tcl::OptKeyDelete {key} { # as it is way faster or simply OptProc which does it all) # Assign a temporary key, call OptKeyParse and then free the storage proc ::tcl::OptParse {desc arglist} { - set tempkey [OptKeyRegister $desc]; - set ret [catch {uplevel 1 [list ::tcl::OptKeyParse $tempkey $arglist]} res]; - OptKeyDelete $tempkey; - return -code $ret $res; + set tempkey [OptKeyRegister $desc] + set ret [catch {uplevel 1 [list ::tcl::OptKeyParse $tempkey $arglist]} res] + OptKeyDelete $tempkey + return -code $ret $res } # Helper function, replacement for proc that both @@ -246,22 +246,22 @@ proc ::tcl::OptParse {desc arglist} { # (the other will be sets to their default value) # into local variable named "Args". proc ::tcl::OptProc {name desc body} { - set namespace [uplevel 1 [list ::namespace current]]; + set namespace [uplevel 1 [list ::namespace current]] if {[string match "::*" $name] || [string equal $namespace "::"]} { # absolute name or global namespace, name is the key - set key $name; + set key $name } else { # we are relative to some non top level namespace: - set key "${namespace}::${name}"; + set key "${namespace}::${name}" } - OptKeyRegister $desc $key; - uplevel 1 [list ::proc $name args "set Args \[::tcl::OptKeyParse $key \$args\]\n$body"]; - return $key; + OptKeyRegister $desc $key + uplevel 1 [list ::proc $name args "set Args \[::tcl::OptKeyParse $key \$args\]\n$body"] + return $key } # Check that a argument has been given # assumes that "OptProc" has been used as it will check in "Args" list proc ::tcl::OptProcArgGiven {argname} { - upvar Args alist; + upvar Args alist expr {[lsearch $alist $argname] >=0} } @@ -270,7 +270,7 @@ proc ::tcl::OptProcArgGiven {argname} { # Return the instruction word/list of a given step/(sub)program proc OptInstr {lst} { - lindex $lst 0; + lindex $lst 0 } # Is a (sub) program or a plain instruction ? proc OptIsPrg {lst} { @@ -286,56 +286,56 @@ proc ::tcl::OptProcArgGiven {argname} { } # Current program counter (2nd word of first word) proc OptSetPrgCounter {lstName newValue} { - upvar $lstName lst; - set lst [lreplace $lst 0 0 [concat "P" $newValue]]; + upvar $lstName lst + set lst [lreplace $lst 0 0 [concat "P" $newValue]] } # returns a list of currently selected items. proc OptSelection {lst} { - set res {}; + set res {} foreach idx [lrange [lindex $lst 0] 1 end] { - lappend res [Lget $lst $idx]; + lappend res [Lget $lst $idx] } - return $res; + return $res } # Advance to next description proc OptNextDesc {descName} { - uplevel 1 [list Lvarincr $descName {0 1}]; + uplevel 1 [list Lvarincr $descName {0 1}] } # Get the current description, eventually descend proc OptCurDesc {descriptions} { - lindex $descriptions [OptGetPrgCounter $descriptions]; + lindex $descriptions [OptGetPrgCounter $descriptions] } # get the current description, eventually descend # through sub programs as needed. proc OptCurDescFinal {descriptions} { - set item [OptCurDesc $descriptions]; + set item [OptCurDesc $descriptions] # Descend untill we get the actual item and not a sub program while {[OptIsPrg $item]} { - set item [OptCurDesc $item]; + set item [OptCurDesc $item] } - return $item; + return $item } # Current final instruction adress proc OptCurAddr {descriptions {start {}}} { - set adress [OptGetPrgCounter $descriptions]; - lappend start $adress; - set item [lindex $descriptions $adress]; + set adress [OptGetPrgCounter $descriptions] + lappend start $adress + set item [lindex $descriptions $adress] if {[OptIsPrg $item]} { - return [OptCurAddr $item $start]; + return [OptCurAddr $item $start] } else { - return $start; + return $start } } # Set the value field of the current instruction proc OptCurSetValue {descriptionsName value} { upvar $descriptionsName descriptions # get the current item full adress - set adress [OptCurAddr $descriptions]; + set adress [OptCurAddr $descriptions] # use the 3th field of the item (see OptValue / OptNewInst) lappend adress 2 - Lvarset descriptions $adress [list 1 $value]; + Lvarset descriptions $adress [list 1 $value] # ^hasBeenSet flag } @@ -346,7 +346,7 @@ proc ::tcl::OptProcArgGiven {argname} { # current state proc OptCurState {descriptions} { - OptState [OptCurDesc $descriptions]; + OptState [OptCurDesc $descriptions] } ####### @@ -354,11 +354,11 @@ proc ::tcl::OptProcArgGiven {argname} { # Returns the argument that has to be processed now proc OptCurrentArg {lst} { - lindex $lst 0; + lindex $lst 0 } # Advance to next argument proc OptNextArg {argsName} { - uplevel 1 [list Lvarpop1 $argsName]; + uplevel 1 [list Lvarpop1 $argsName] } ####### @@ -370,49 +370,49 @@ proc ::tcl::OptProcArgGiven {argname} { # eventually eat all the arguments. proc OptDoAll {descriptionsName argumentsName} { upvar $descriptionsName descriptions - upvar $argumentsName arguments; -# puts "entered DoAll"; + upvar $argumentsName arguments +# puts "entered DoAll" # Nb: the places where "state" can be set are tricky to figure # because DoOne sets the state to flagsValue and return -continue # when needed... - set state [OptCurState $descriptions]; + set state [OptCurState $descriptions] # We'll exit the loop in "OptDoOne" or when state is empty. while 1 { - set curitem [OptCurDesc $descriptions]; + set curitem [OptCurDesc $descriptions] # Do subprograms if needed, call ourselves on the sub branch while {[OptIsPrg $curitem]} { OptDoAll curitem arguments -# puts "done DoAll sub"; - # Insert back the results in current tree; +# puts "done DoAll sub" + # Insert back the results in current tree Lvarset1nc descriptions [OptGetPrgCounter $descriptions]\ - $curitem; - OptNextDesc descriptions; - set curitem [OptCurDesc $descriptions]; - set state [OptCurState $descriptions]; + $curitem + OptNextDesc descriptions + set curitem [OptCurDesc $descriptions] + set state [OptCurState $descriptions] } -# puts "state = \"$state\" - arguments=($arguments)"; +# puts "state = \"$state\" - arguments=($arguments)" if {[Lempty $state]} { # Nothing left to do, we are done in this branch: - break; + break } # The following statement can make us terminate/continue # as it use return -code {break, continue, return and error} # codes - OptDoOne descriptions state arguments; + OptDoOne descriptions state arguments # If we are here, no special return code where issued, # we'll step to next instruction : -# puts "new state = \"$state\""; - OptNextDesc descriptions; - set state [OptCurState $descriptions]; +# puts "new state = \"$state\"" + OptNextDesc descriptions + set state [OptCurState $descriptions] } } # Process one step for the state machine, # eventually consuming the current argument. proc OptDoOne {descriptionsName stateName argumentsName} { - upvar $argumentsName arguments; - upvar $descriptionsName descriptions; - upvar $stateName state; + upvar $argumentsName arguments + upvar $descriptionsName descriptions + upvar $stateName state # the special state/instruction "args" eats all # the remaining args (if any) @@ -420,27 +420,27 @@ proc ::tcl::OptProcArgGiven {argname} { if {![Lempty $arguments]} { # If there is no additional arguments, leave the default value # in. - OptCurSetValue descriptions $arguments; - set arguments {}; + OptCurSetValue descriptions $arguments + set arguments {} } # puts "breaking out ('args' state: consuming every reminding args)" - return -code break; + return -code break } if {[Lempty $arguments]} { if {$state == "flags"} { # no argument and no flags : we're done -# puts "returning to previous (sub)prg (no more args)"; - return -code return; +# puts "returning to previous (sub)prg (no more args)" + return -code return } elseif {$state == "optValue"} { set state next; # not used, for debug only # go to next state - return ; + return } else { - return -code error [OptMissingValue $descriptions]; + return -code error [OptMissingValue $descriptions] } } else { - set arg [OptCurrentArg $arguments]; + set arg [OptCurrentArg $arguments] } switch $state { @@ -450,62 +450,62 @@ proc ::tcl::OptProcArgGiven {argname} { # Still a flag ? if {![OptIsFlag $arg]} { # don't consume the argument, return to previous prg - return -code return; + return -code return } # consume the flag - OptNextArg arguments; + OptNextArg arguments if {[string equal "--" $arg]} { # return from 'flags' state - return -code return; + return -code return } - set hits [OptHits descriptions $arg]; + set hits [OptHits descriptions $arg] if {$hits > 1} { return -code error [OptAmbigous $descriptions $arg] } elseif {$hits == 0} { return -code error [OptFlagUsage $descriptions $arg] } - set item [OptCurDesc $descriptions]; + set item [OptCurDesc $descriptions] if {[OptNeedValue $item]} { # we need a value, next state is - set state flagValue; + set state flagValue } else { - OptCurSetValue descriptions 1; + OptCurSetValue descriptions 1 } # continue - return -code continue; + return -code continue } flagValue - value { - set item [OptCurDesc $descriptions]; + set item [OptCurDesc $descriptions] # Test the values against their required type if {[catch {OptCheckType $arg\ [OptType $item] [OptTypeArgs $item]} val]} { return -code error [OptBadValue $item $arg $val] } # consume the value - OptNextArg arguments; + OptNextArg arguments # set the value - OptCurSetValue descriptions $val; + OptCurSetValue descriptions $val # go to next state if {$state == "flagValue"} { set state flags - return -code continue; + return -code continue } else { set state next; # not used, for debug only return ; # will go on next step } } optValue { - set item [OptCurDesc $descriptions]; + set item [OptCurDesc $descriptions] # Test the values against their required type if {![catch {OptCheckType $arg\ [OptType $item] [OptTypeArgs $item]} val]} { # right type, so : # consume the value - OptNextArg arguments; + OptNextArg arguments # set the value - OptCurSetValue descriptions $val; + OptCurSetValue descriptions $val } # go to next state set state next; # not used, for debug only @@ -516,39 +516,39 @@ proc ::tcl::OptProcArgGiven {argname} { # state as been entered ! return -code error "Bug! unknown state in DoOne \"$state\"\ (prg counter [OptGetPrgCounter $descriptions]:\ - [OptCurDesc $descriptions])"; + [OptCurDesc $descriptions])" } # Parse the options given the key to previously registered description # and arguments list proc ::tcl::OptKeyParse {descKey arglist} { - set desc [OptKeyGetDesc $descKey]; + set desc [OptKeyGetDesc $descKey] # make sure -help always give usage if {[string equal -nocase "-help" $arglist]} { - return -code error [OptError "Usage information:" $desc 1]; + return -code error [OptError "Usage information:" $desc 1] } - OptDoAll desc arglist; + OptDoAll desc arglist if {![Lempty $arglist]} { - return -code error [OptTooManyArgs $desc $arglist]; + return -code error [OptTooManyArgs $desc $arglist] } # Analyse the result # Walk through the tree: - OptTreeVars $desc "#[expr {[info level]-1}]" ; + OptTreeVars $desc "#[expr {[info level]-1}]" } # determine string length for nice tabulated output proc OptTreeVars {desc level {vnamesLst {}}} { foreach item $desc { - if {[OptIsCounter $item]} continue; + if {[OptIsCounter $item]} continue if {[OptIsPrg $item]} { - set vnamesLst [OptTreeVars $item $level $vnamesLst]; + set vnamesLst [OptTreeVars $item $level $vnamesLst] } else { - set vname [OptVarName $item]; + set vname [OptVarName $item] upvar $level $vname var if {[OptHasBeenSet $item]} { # puts "adding $vname" @@ -556,10 +556,10 @@ proc ::tcl::OptKeyParse {descKey arglist} { # it is more usefull, for instance you can check that # no flags at all was given with expr # {![string match "*-*" $Args]} - lappend vnamesLst [OptName $item]; - set var [OptValue $item]; + lappend vnamesLst [OptName $item] + set var [OptValue $item] } else { - set var [OptDefaultValue $item]; + set var [OptDefaultValue $item] } } } @@ -571,7 +571,7 @@ proc ::tcl::OptKeyParse {descKey arglist} { # and emit an error if arg is not of the correct type # otherwise returns the canonical value of that arg (ie 0/1 for booleans) proc ::tcl::OptCheckType {arg type {typeArgs ""}} { -# puts "checking '$arg' against '$type' ($typeArgs)"; +# puts "checking '$arg' against '$type' ($typeArgs)" # only types "any", "choice", and numbers can have leading "-" @@ -580,7 +580,7 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { if {![string is integer -strict $arg]} { error "not an integer" } - return $arg; + return $arg } float { return [expr {double($arg)}] @@ -591,7 +591,7 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { if {[llength $arg]==0 && [OptIsFlag $arg]} { error "no values with leading -" } - return $arg; + return $arg } boolean { if {![string is boolean -strict $arg]} { @@ -604,10 +604,10 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { if {[lsearch -exact $typeArgs $arg] < 0} { error "invalid choice" } - return $arg; + return $arg } any { - return $arg; + return $arg } string - default { @@ -617,7 +617,7 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { return $arg } } - return neverReached; + return neverReached } # internal utilities @@ -625,34 +625,34 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { # returns the number of flags matching the given arg # sets the (local) prg counter to the list of matches proc OptHits {descName arg} { - upvar $descName desc; + upvar $descName desc set hits 0 set hitems {} - set i 1; + set i 1 - set larg [string tolower $arg]; - set len [string length $larg]; - set last [expr {$len-1}]; + set larg [string tolower $arg] + set len [string length $larg] + set last [expr {$len-1}] foreach item [lrange $desc 1 end] { set flag [OptName $item] # lets try to match case insensitively # (string length ought to be cheap) - set lflag [string tolower $flag]; + set lflag [string tolower $flag] if {$len == [string length $lflag]} { if {[string equal $larg $lflag]} { # Exact match case - OptSetPrgCounter desc $i; - return 1; + OptSetPrgCounter desc $i + return 1 } } elseif {[string equal $larg [string range $lflag 0 $last]]} { - lappend hitems $i; - incr hits; + lappend hitems $i + incr hits } - incr i; + incr i } if {$hits} { - OptSetPrgCounter desc $hitems; + OptSetPrgCounter desc $hitems } return $hits } @@ -660,29 +660,29 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { # Extract fields from the list structure: proc OptName {item} { - lindex $item 1; + lindex $item 1 } proc OptHasBeenSet {item} { - Lget $item {2 0}; + Lget $item {2 0} } proc OptValue {item} { - Lget $item {2 1}; + Lget $item {2 1} } proc OptIsFlag {name} { - string match "-*" $name; + string match "-*" $name } proc OptIsOpt {name} { - string match {\?*} $name; + string match {\?*} $name } proc OptVarName {item} { - set name [OptName $item]; + set name [OptName $item] if {[OptIsFlag $name]} { - return [string range $name 1 end]; + return [string range $name 1 end] } elseif {[OptIsOpt $name]} { - return [string trim $name "?"]; + return [string trim $name "?"] } else { - return $name; + return $name } } proc OptType {item} { @@ -719,13 +719,13 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { proc OptOptUsage {item {what ""}} { return -code error "invalid description format$what: $item\n\ should be a list of {varname|-flagname ?-type? ?defaultvalue?\ - ?helpstring?}"; + ?helpstring?}" } # Generate a canonical form single instruction proc OptNewInst {state varname type typeArgs help} { - list $state $varname [list 0 {}] $type $typeArgs $help; + list $state $varname [list 0 {}] $type $typeArgs $help # ^ ^ # | | # hasBeenSet=+ +=currentValue @@ -733,18 +733,18 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { # Translate one item to canonical form proc OptNormalizeOne {item} { - set lg [Lassign $item varname arg1 arg2 arg3]; -# puts "called optnormalizeone '$item' v=($varname), lg=$lg"; - set isflag [OptIsFlag $varname]; - set isopt [OptIsOpt $varname]; + set lg [Lassign $item varname arg1 arg2 arg3] +# puts "called optnormalizeone '$item' v=($varname), lg=$lg" + set isflag [OptIsFlag $varname] + set isopt [OptIsOpt $varname] if {$isflag} { - set state "flags"; + set state "flags" } elseif {$isopt} { - set state "optValue"; + set state "optValue" } elseif {![string equal $varname "args"]} { - set state "value"; + set state "value" } else { - set state "args"; + set state "args" } # apply 'smart' 'fuzzy' logic to try to make @@ -754,9 +754,9 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { switch $lg { 1 { if {$isflag} { - return [OptNewInst $state $varname boolflag false ""]; + return [OptNewInst $state $varname boolflag false ""] } else { - return [OptNewInst $state $varname any "" ""]; + return [OptNewInst $state $varname any "" ""] } } 2 { @@ -776,7 +776,7 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { set help "" set def $arg1 } - return [OptNewInst $state $varname $type $def $help]; + return [OptNewInst $state $varname $type $def $help] } 3 { # varname type value @@ -787,9 +787,9 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { # on the contrary, for a variable (non optional), # default value is pointless, 'cept for choices : if {$isflag || $isopt || ($type == "choice")} { - return [OptNewInst $state $varname $type $arg2 ""]; + return [OptNewInst $state $varname $type $arg2 ""] } else { - return [OptNewInst $state $varname $type "" $arg2]; + return [OptNewInst $state $varname $type "" $arg2] } } else { return [OptNewInst $state $varname\ @@ -798,13 +798,13 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { } 4 { if {[regexp {^-(.+)$} $arg1 x type]} { - return [OptNewInst $state $varname $type $arg2 $arg3]; + return [OptNewInst $state $varname $type $arg2 $arg3] } else { - return -code error [OptOptUsage $item]; + return -code error [OptOptUsage $item] } } default { - return -code error [OptOptUsage $item]; + return -code error [OptOptUsage $item] } } } @@ -829,7 +829,7 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { OptError "ambigous option \"$arg\", choose from:" [OptSelection $desc] } proc OptFlagUsage {desc arg} { - OptError "bad flag \"$arg\", must be one of" $desc; + OptError "bad flag \"$arg\", must be one of" $desc } proc OptTooManyArgs {desc arguments} { OptError "too many arguments (unexpected argument(s): $arguments),\ @@ -838,45 +838,45 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { } proc OptParamType {item} { if {[OptIsFlag $item]} { - return "flag"; + return "flag" } else { - return "parameter"; + return "parameter" } } proc OptBadValue {item arg {err {}}} { -# puts "bad val err = \"$err\""; +# puts "bad val err = \"$err\"" OptError "bad value \"$arg\" for [OptParamType $item]"\ [list $item] } proc OptMissingValue {descriptions} { -# set item [OptCurDescFinal $descriptions]; - set item [OptCurDesc $descriptions]; +# set item [OptCurDescFinal $descriptions] + set item [OptCurDesc $descriptions] OptError "no value given for [OptParamType $item] \"[OptName $item]\"\ (use -help for full usage) :"\ [list $item] } proc ::tcl::OptKeyError {prefix descKey {header 0}} { - OptError $prefix [OptKeyGetDesc $descKey] $header; + OptError $prefix [OptKeyGetDesc $descKey] $header } # determine string length for nice tabulated output proc OptLengths {desc nlName tlName dlName} { - upvar $nlName nl; - upvar $tlName tl; - upvar $dlName dl; + upvar $nlName nl + upvar $tlName tl + upvar $dlName dl foreach item $desc { - if {[OptIsCounter $item]} continue; + if {[OptIsCounter $item]} continue if {[OptIsPrg $item]} { OptLengths $item nl tl dl } else { SetMax nl [string length [OptName $item]] SetMax tl [string length [OptType $item]] - set dv [OptTypeArgs $item]; + set dv [OptTypeArgs $item] if {[OptState $item] != "header"} { - set dv "($dv)"; + set dv "($dv)" } - set l [string length $dv]; + set l [string length $dv] # limit the space allocated to potentially big "choices" if {([OptType $item] != "choice") || ($l<=12)} { SetMax dl $l @@ -890,22 +890,22 @@ proc ::tcl::OptKeyError {prefix descKey {header 0}} { } # output the tree proc OptTree {desc nl tl dl} { - set res ""; + set res "" foreach item $desc { - if {[OptIsCounter $item]} continue; + if {[OptIsCounter $item]} continue if {[OptIsPrg $item]} { - append res [OptTree $item $nl $tl $dl]; + append res [OptTree $item $nl $tl $dl] } else { - set dv [OptTypeArgs $item]; + set dv [OptTypeArgs $item] if {[OptState $item] != "header"} { - set dv "($dv)"; + set dv "($dv)" } - append res [format "\n %-*s %-*s %-*s %s" \ + append res [string trimright [format "\n %-*s %-*s %-*s %s" \ $nl [OptName $item] $tl [OptType $item] \ - $dl $dv [OptHelp $item]] + $dl $dv [OptHelp $item]]] } } - return $res; + return $res } # Give nice usage string @@ -913,9 +913,9 @@ proc ::tcl::OptError {prefix desc {header 0}} { # determine length if {$header} { # add faked instruction - set h [list [OptNewInst header Var/FlagName Type Value Help]]; - lappend h [OptNewInst header ------------ ---- ----- ----]; - lappend h [OptNewInst header {( -help} "" "" {gives this help )}] + set h [list [OptNewInst header Var/FlagName Type Value Help]] + lappend h [OptNewInst header ------------ ---- ----- ----] + lappend h [OptNewInst header {(-help} "" "" {gives this help)}] set desc [concat $h $desc] } OptLengths $desc nl tl dl @@ -943,9 +943,9 @@ proc ::tcl::Lempty {list} { # Gets the value of one leaf of a lists tree proc ::tcl::Lget {list indexLst} { if {[llength $indexLst] <= 1} { - return [lindex $list $indexLst]; + return [lindex $list $indexLst] } - Lget [lindex $list [lindex $indexLst 0]] [lrange $indexLst 1 end]; + Lget [lindex $list [lindex $indexLst 0]] [lrange $indexLst 1 end] } # Sets the value of one leaf of a lists tree # (we use the version that does not create the elements because @@ -956,92 +956,92 @@ proc ::tcl::Lget {list indexLst} { # it should be {a} and [listp a] should be 0 while [listp {a b}] would be 1 # and [listp "a b"] maybe 0. listp does not exist either...) proc ::tcl::Lvarset {listName indexLst newValue} { - upvar $listName list; + upvar $listName list if {[llength $indexLst] <= 1} { - Lvarset1nc list $indexLst $newValue; + Lvarset1nc list $indexLst $newValue } else { - set idx [lindex $indexLst 0]; - set targetList [lindex $list $idx]; + set idx [lindex $indexLst 0] + set targetList [lindex $list $idx] # reduce refcount on targetList (not really usefull now, # could be with optimizing compiler) -# Lvarset1 list $idx {}; +# Lvarset1 list $idx {} # recursively replace in targetList - Lvarset targetList [lrange $indexLst 1 end] $newValue; + Lvarset targetList [lrange $indexLst 1 end] $newValue # put updated sub list back in the tree - Lvarset1nc list $idx $targetList; + Lvarset1nc list $idx $targetList } } # Set one cell to a value, eventually create all the needed elements # (on level-1 of lists) variable emptyList {} proc ::tcl::Lvarset1 {listName index newValue} { - upvar $listName list; + upvar $listName list if {$index < 0} {return -code error "invalid negative index"} - set lg [llength $list]; + set lg [llength $list] if {$index >= $lg} { - variable emptyList; + variable emptyList for {set i $lg} {$i<$index} {incr i} { - lappend list $emptyList; + lappend list $emptyList } - lappend list $newValue; + lappend list $newValue } else { - set list [lreplace $list $index $index $newValue]; + set list [lreplace $list $index $index $newValue] } } # same as Lvarset1 but no bound checking / creation proc ::tcl::Lvarset1nc {listName index newValue} { - upvar $listName list; - set list [lreplace $list $index $index $newValue]; + upvar $listName list + set list [lreplace $list $index $index $newValue] } # Increments the value of one leaf of a lists tree # (which must exists) proc ::tcl::Lvarincr {listName indexLst {howMuch 1}} { - upvar $listName list; + upvar $listName list if {[llength $indexLst] <= 1} { - Lvarincr1 list $indexLst $howMuch; + Lvarincr1 list $indexLst $howMuch } else { - set idx [lindex $indexLst 0]; - set targetList [lindex $list $idx]; + set idx [lindex $indexLst 0] + set targetList [lindex $list $idx] # reduce refcount on targetList - Lvarset1nc list $idx {}; + Lvarset1nc list $idx {} # recursively replace in targetList - Lvarincr targetList [lrange $indexLst 1 end] $howMuch; + Lvarincr targetList [lrange $indexLst 1 end] $howMuch # put updated sub list back in the tree - Lvarset1nc list $idx $targetList; + Lvarset1nc list $idx $targetList } } # Increments the value of one cell of a list proc ::tcl::Lvarincr1 {listName index {howMuch 1}} { - upvar $listName list; - set newValue [expr {[lindex $list $index]+$howMuch}]; - set list [lreplace $list $index $index $newValue]; - return $newValue; + upvar $listName list + set newValue [expr {[lindex $list $index]+$howMuch}] + set list [lreplace $list $index $index $newValue] + return $newValue } # Removes the first element of a list # and returns the new list value proc ::tcl::Lvarpop1 {listName} { - upvar $listName list; - set list [lrange $list 1 end]; + upvar $listName list + set list [lrange $list 1 end] } # Same but returns the removed element # (Like the tclX version) proc ::tcl::Lvarpop {listName} { - upvar $listName list; - set el [lindex $list 0]; - set list [lrange $list 1 end]; - return $el; + upvar $listName list + set el [lindex $list 0] + set list [lrange $list 1 end] + return $el } # Assign list elements to variables and return the length of the list proc ::tcl::Lassign {list args} { # faster than direct blown foreach (which does not byte compile) - set i 0; - set lg [llength $list]; + set i 0 + set lg [llength $list] foreach vname $args { if {$i>=$lg} break - uplevel 1 [list ::set $vname [lindex $list $i]]; - incr i; + uplevel 1 [list ::set $vname [lindex $list $i]] + incr i } - return $lg; + return $lg } # Misc utilities diff --git a/library/opt/pkgIndex.tcl b/library/opt/pkgIndex.tcl index c5d3635..daf9aa9 100644 --- a/library/opt/pkgIndex.tcl +++ b/library/opt/pkgIndex.tcl @@ -8,5 +8,5 @@ # script is sourced, the variable $dir must contain the # full path name of this file's directory. -if {![package vsatisfies [package provide Tcl] 8.2]} {return} -package ifneeded opt 0.4.5 [list source [file join $dir optparse.tcl]] +if {![package vsatisfies [package provide Tcl] 8.5-]} {return} +package ifneeded opt 0.4.7 [list source [file join $dir optparse.tcl]] diff --git a/tests/opt.test b/tests/opt.test index ba59f6c..8b7289a 100644 --- a/tests/opt.test +++ b/tests/opt.test @@ -77,7 +77,7 @@ test opt-6.1 {OptKeyParse} { } {1 {Usage information: Var/FlagName Type Value Help ------------ ---- ----- ---- - ( -help gives this help )}} + (-help gives this help)}} test opt-7.1 {OptCheckType} { list \ @@ -159,9 +159,9 @@ test opt-10.1 {ambigous flags} { catch {optTest -fL} msg set msg } {ambigous option "-fL", choose from: - -fla boolflag (false) - -flag2xyz boolflag (false) - -flag3xyz boolflag (false) } + -fla boolflag (false) + -flag2xyz boolflag (false) + -flag3xyz boolflag (false)} test opt-10.2 {non ambigous flags} { ::tcl::OptProc optTest {{-flag1xyz} {-other} {-flag2xyz} {-flag3xyz}} { return $flag2xyz @@ -181,8 +181,8 @@ test opt-10.4 {ambigous flags, not exact match} { catch {optTest -fLag1X} msg set msg } {ambigous option "-fLag1X", choose from: - -flag1xy boolflag (false) - -flag1xyz boolflag (false) } + -flag1xy boolflag (false) + -flag1xyz boolflag (false)} # medium size overall test example: (defined once) ::tcl::OptProc optTest { @@ -204,12 +204,12 @@ test opt-10.6 {medium size overall test} { } {1 {Usage information: Var/FlagName Type Value Help ------------ ---- ----- ---- - ( -help gives this help ) + (-help gives this help) cmd choice (print save delete) sub command to choose - -allowBoing boolean (true) + -allowBoing boolean (true) arg2 string () this is help ?arg3? int (7) optional number - -moreflags boolflag (false) }} + -moreflags boolflag (false)}} test opt-10.7 {medium size overall test} { optTest save tst } {save 1 tst 7 0} @@ -230,8 +230,8 @@ test opt-11.1 {too many args test 2} { } {1 {too many arguments (unexpected argument(s): blah), usage: Var/FlagName Type Value Help ------------ ---- ----- ---- - ( -help gives this help ) - -foo boolflag (false) } {}} + (-help gives this help) + -foo boolflag (false)} {}} test opt-11.2 {default value for args} { set args {} set key [::tcl::OptKeyRegister {{args -list {a b c} "args..."}}] diff --git a/tests/safe.test b/tests/safe.test index 00a9472..965bc8b 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -40,7 +40,7 @@ test safe-1.2 {safe::interpCreate syntax} { } {1 {Usage information: Var/FlagName Type Value Help ------------ ---- ----- ---- - ( -help gives this help ) + (-help gives this help) ?slave? name () name of the slave (optional) -accessPath list () access path for the slave -noStatics boolflag (false) prevent loading of statically linked pkgs -- cgit v0.12 From 122bb72a66973fecc8939b5bb376d2b65334738b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 28 Nov 2019 12:53:38 +0000 Subject: Enhance rules.vc like already done in other configure scripts: Determine HAVE_STDINT_H/HAVE_INTTYPES_H/HAVE_STDBOOL_H/MP_NO_STDINT the simple way, just by compiler version. --- win/makefile.vc | 2 +- win/rules.vc | 13 ++++++++++++- win/tclWinPort.h | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/win/makefile.vc b/win/makefile.vc index fe9b790..26f7da3 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -418,7 +418,7 @@ PKGSDIR = $(ROOT)\pkgs # Additional include and C macro definitions for the implicit rules # defined in rules.vc PRJ_INCLUDES = -I"$(TOMMATHDIR)" -PRJ_DEFINES = /DTCL_TOMMATH /DMP_PREC=4 /Dinline=__inline /DHAVE_ZLIB=1 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DMP_FIXED_CUTOFFS /DMP_NO_STDINT +PRJ_DEFINES = /DTCL_TOMMATH /DMP_PREC=4 /Dinline=__inline /DHAVE_ZLIB=1 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DMP_FIXED_CUTOFFS # Additional Link libraries needed beyond those in rules.vc PRJ_LIBS = netapi32.lib user32.lib userenv.lib ws2_32.lib diff --git a/win/rules.vc b/win/rules.vc index 2061e9b..8050ed3 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -24,7 +24,7 @@ _RULES_VC = 1 # For modifications that are not backward-compatible, you *must* change # the major version. RULES_VERSION_MAJOR = 1 -RULES_VERSION_MINOR = 5 +RULES_VERSION_MINOR = 6 # The PROJECT macro must be defined by parent makefile. !if "$(PROJECT)" == "" @@ -1291,6 +1291,17 @@ INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\..\include # define PRJ_LIBS before including rules.rc if additional libs are needed OPTDEFINES = /DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) /DSTDC_HEADERS +!if $(VCVERSION) >= 1600 +OPTDEFINES = $(OPTDEFINES) /DHAVE_STDINT_H=1 +!else +OPTDEFINES = $(OPTDEFINES) /DMP_NO_STDINT=1 +!endif +!if $(VCVERSION) >= 1700 +OPTDEFINES = $(OPTDEFINES) /DHAVE_INTTYPES_H=1 +!endif +!if $(VCVERSION) >= 1800 +OPTDEFINES = $(OPTDEFINES) /DHAVE_STDBOOL_H=1 +!endif !if $(TCL_MEM_DEBUG) OPTDEFINES = $(OPTDEFINES) /DTCL_MEM_DEBUG diff --git a/win/tclWinPort.h b/win/tclWinPort.h index 5e63c02..e2eae56 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -92,7 +92,7 @@ typedef DWORD_PTR * PDWORD_PTR; #include #include #include -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include #endif #include -- cgit v0.12 From 800a3f62b322f5dce3636afcd726167263ad44da Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 29 Nov 2019 09:52:09 +0000 Subject: Fix one failing testcase (thanks, Travis!) --- tests/http.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/http.test b/tests/http.test index 3f0b55d..8eac3c3 100644 --- a/tests/http.test +++ b/tests/http.test @@ -680,7 +680,7 @@ test http-idna-1.2 {IDNA package: basics} -returnCodes error -body { } -result {unknown or ambiguous subcommand "?": must be decode, encode, puny, or version} test http-idna-1.3 {IDNA package: basics} -body { ::tcl::idna version -} -result 1.0 +} -result 1.0.1 test http-idna-1.4 {IDNA package: basics} -returnCodes error -body { ::tcl::idna version what } -result {wrong # args: should be "::tcl::idna version"} -- cgit v0.12 From 332401e6453aa9e5621de6fa085169ca2ce51c8c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 29 Nov 2019 12:27:00 +0000 Subject: Add some new test-cases involving e.g. Unicode 11. Backported from Tcl 8.7a3 --- tests/utf.test | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/tests/utf.test b/tests/utf.test index 95775a8..c43d95a 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -44,6 +44,18 @@ test utf-1.6 {Tcl_UniCharToUtf: negative Tcl_UniChar} testbytestring { test utf-1.7 {Tcl_UniCharToUtf: 4 byte sequences} -constraints {fullutf testbytestring} -body { expr {"\U014e4e" eq [testbytestring "\xf0\x94\xb9\x8e"]} } -result 1 +test utf-1.8 {Tcl_UniCharToUtf: 3 byte sequence, high surrogate} testbytestring { + expr {"\ud842" eq [testbytestring "\xed\xa1\x82"]} +} 1 +test utf-1.9 {Tcl_UniCharToUtf: 3 byte sequence, low surrogate} testbytestring { + expr {"\udc42" eq [testbytestring "\xed\xb1\x82"]} +} 1 +test utf-1.10 {Tcl_UniCharToUtf: 3 byte sequence, high surrogate} testbytestring { + expr {[format %c 0xd842] eq [testbytestring "\xed\xa1\x82"]} +} 1 +test utf-1.11 {Tcl_UniCharToUtf: 3 byte sequence, low surrogate} testbytestring { + expr {[format %c 0xdc42] eq [testbytestring "\xed\xb1\x82"]} +} 1 test utf-2.1 {Tcl_UtfToUniChar: low ascii} { string length "abc" @@ -96,7 +108,7 @@ test utf-4.2 {Tcl_NumUtfChars: length 1} {testnumutfchars testbytestring} { testnumutfchars [testbytestring "\xC2\xA2"] } {1} test utf-4.3 {Tcl_NumUtfChars: long string} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "abc\xC2\xA2\xe4\xb9\x8e\uA2\u4e4e"] + testnumutfchars [testbytestring "abc\xC2\xA2\xE4\xB9\x8E\uA2\x4E"] } {7} test utf-4.4 {Tcl_NumUtfChars: #u0000} {testnumutfchars testbytestring} { testnumutfchars [testbytestring "\xC0\x80"] @@ -108,7 +120,7 @@ test utf-4.6 {Tcl_NumUtfChars: length 1, calc len} {testnumutfchars testbytestri testnumutfchars [testbytestring "\xC2\xA2"] 2 } {1} test utf-4.7 {Tcl_NumUtfChars: long string, calc len} {testnumutfchars testbytestring} { - testnumutfchars [testbytestring "abc\xC2\xA2\xe4\xb9\x8e\uA2\u4e4e"] 10 + testnumutfchars [testbytestring "abc\xC2\xA2\xE4\xB9\x8E\uA2\x4E"] 10 } {7} test utf-4.8 {Tcl_NumUtfChars: #u0000, calc len} {testnumutfchars testbytestring} { testnumutfchars [testbytestring "\xC0\x80"] 2 @@ -250,6 +262,9 @@ test utf-11.3 {Tcl_UtfToUpper} { test utf-11.4 {Tcl_UtfToUpper} { string toupper \u01e3ab } \u01e2AB +test utf-11.5 {Tcl_UtfToUpper Georgian (new in Unicode 11)} { + string toupper \u10d0\u1c90 +} \u1c90\u1c90 test utf-12.1 {Tcl_UtfToLower} { string tolower {} @@ -263,6 +278,9 @@ test utf-12.3 {Tcl_UtfToLower} { test utf-12.4 {Tcl_UtfToLower} { string tolower \u01e2AB } \u01e3ab +test utf-12.5 {Tcl_UtfToLower Georgian (new in Unicode 11)} { + string tolower \u10d0\u1c90 +} \u10d0\u10d0 test utf-13.1 {Tcl_UtfToTitle} { string totitle {} @@ -276,6 +294,12 @@ test utf-13.3 {Tcl_UtfToTitle} { test utf-13.4 {Tcl_UtfToTitle} { string totitle \u01f3ab } \u01f2ab +test utf-13.5 {Tcl_UtfToTitle Georgian (new in Unicode 11)} { + string totitle \u10d0\u1c90 +} \u10d0\u1c90 +test utf-13.6 {Tcl_UtfToTitle Georgian (new in Unicode 11)} { + string totitle \u1c90\u10d0 +} \u1c90\u10d0 test utf-14.1 {Tcl_UtfNcasecmp} { string compare -nocase a b -- cgit v0.12 From 3435c9713f7b20d9061a5b2758728e66846c8989 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Sun, 1 Dec 2019 11:59:41 +0000 Subject: add tcltest::SetupTest to make it easier to customize the -setup step of a test --- library/tcltest/tcltest.tcl | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index a7a68c7..2d36d13 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -1983,7 +1983,8 @@ proc tcltest::test {name description args} { } # First, run the setup script - set code [catch {uplevel 1 $setup} setupMsg] + lassign [uplevel 1 [list [ + namespace which SetupScript] $setup]] code setupMsg if {$code == 1} { set errorInfo(setup) $::errorInfo set errorCodeRes(setup) $::errorCode @@ -2338,6 +2339,8 @@ proc tcltest::Skipped {name constraints} { return 0 } + + # RunTest -- # # This is where the body of a test is evaluated. The combination of @@ -2359,6 +2362,19 @@ proc tcltest::RunTest {name script} { return [list $actualAnswer $code] } + + +# SetupTest -- +# +# Evaluates the -setup script for a test + +proc tcltest::SetupTest {name script} { + DebugPuts 3 [list Setup Script for $name $script] + + set code [catch {uplevel 1 $setup} setupMsg] + return [list $code $setupMsg] +} + ##################################################################### # tcltest::cleanupTestsHook -- -- cgit v0.12 From d138d28133e65fbabfecdf4ed817196b81debc81 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Sun, 1 Dec 2019 13:48:48 +0000 Subject: Fix tcltest::SetupTest added in previous commit. --- library/tcltest/tcltest.tcl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 2d36d13..820e978 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -1983,8 +1983,9 @@ proc tcltest::test {name description args} { } # First, run the setup script - lassign [uplevel 1 [list [ - namespace which SetupScript] $setup]] code setupMsg + set code [catch { + uplevel 1 [list [namespace which SetupTest] $setup] + } setupMsg] if {$code == 1} { set errorInfo(setup) $::errorInfo set errorCodeRes(setup) $::errorCode @@ -2368,11 +2369,8 @@ proc tcltest::RunTest {name script} { # # Evaluates the -setup script for a test -proc tcltest::SetupTest {name script} { - DebugPuts 3 [list Setup Script for $name $script] - - set code [catch {uplevel 1 $setup} setupMsg] - return [list $code $setupMsg] +proc tcltest::SetupTest setup { + uplevel 1 $setup } ##################################################################### -- cgit v0.12 From bd7870ec5f811fc8fb2dab47bce6a007610fae8e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 1 Dec 2019 17:52:17 +0000 Subject: Fix executable flag --- win/tclWinFile.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 win/tclWinFile.c diff --git a/win/tclWinFile.c b/win/tclWinFile.c old mode 100755 new mode 100644 -- cgit v0.12 From 506589f483df5a96c589137d19d963d42372921e Mon Sep 17 00:00:00 2001 From: pooryorick Date: Sun, 1 Dec 2019 19:45:54 +0000 Subject: Add tcltest::EvalTest to make it easier to customize behaviour. --- library/tcltest/tcltest.tcl | 11 +++- tests/info.test | 132 ++++++++++++++++++++++---------------------- 2 files changed, 76 insertions(+), 67 deletions(-) diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 820e978..67a8eb6 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -2358,12 +2358,21 @@ proc tcltest::RunTest {name script} { memory tag $name } - set code [catch {uplevel 1 $script} actualAnswer] + set code [catch {uplevel 1 [list [ + namespace origin EvalTest] $script]} actualAnswer copts] return [list $actualAnswer $code] } +proc tcltest::EvalTest script { + set code [catch {uplevel 1 $script} cres copts] + dict set copts -code $code + dict incr copts -level + return -options $copts $cres +} + + # SetupTest -- # diff --git a/tests/info.test b/tests/info.test index 5fe2240..e8de296 100644 --- a/tests/info.test +++ b/tests/info.test @@ -735,28 +735,28 @@ proc etrace {} { test info-22.0 {info frame, levels} {!singleTestInterp} { info frame -} 7 +} 9 test info-22.1 {info frame, bad level relative} {!singleTestInterp} { # catch is another level!, i.e. we have 8, not 7 - catch {info frame -8} msg + catch {info frame -10} msg set msg -} {bad level "-8"} +} {bad level "-10"} test info-22.2 {info frame, bad level absolute} {!singleTestInterp} { # catch is another level!, i.e. we have 8, not 7 - catch {info frame 9} msg + catch {info frame 11} msg set msg -} {bad level "9"} +} {bad level "11"} test info-22.3 {info frame, current, relative} -match glob -body { info frame 0 -} -result {type source line 750 file */info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type source line 750 file */info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-22.4 {info frame, current, relative, nested} -match glob -body { set res [info frame 0] -} -result {type source line 753 file */info.test cmd {info frame 0} proc ::tcltest::RunTest} -cleanup {unset res} +} -result {type source line 753 file */info.test cmd {info frame 0} proc ::tcltest::EvalTest} -cleanup {unset res} test info-22.5 {info frame, current, absolute} -constraints {!singleTestInterp} -match glob -body { - reduce [info frame 7] -} -result {type source line 756 file info.test cmd {info frame 7} proc ::tcltest::RunTest} + reduce [info frame 9] +} -result {type source line 756 file info.test cmd {info frame 9} proc ::tcltest::EvalTest} test info-22.6 {info frame, global, relative} {!singleTestInterp} { - reduce [info frame -6] + reduce [info frame -8] } {type source line 758 file info.test cmd test\ info-22.6\ \{info\ frame,\ global,\ relative\}\ \{!singleTestInter level 0} test info-22.7 {info frame, global, absolute} {!singleTestInterp} { reduce [info frame 1] @@ -764,8 +764,8 @@ test info-22.7 {info frame, global, absolute} {!singleTestInterp} { test info-22.8 {info frame, basic trace} -match glob -body { join [lrange [etrace] 0 2] \n } -result {* {type source line 730 file info.test cmd {info frame $level} proc ::etrace level 0} -* {type source line 765 file info.test cmd etrace proc ::tcltest::RunTest} -* {type source line * file tcltest* cmd {uplevel 1 $script} proc ::tcltest::RunTest}} +* {type source line 765 file info.test cmd etrace proc ::tcltest::EvalTest} +* {type source line * file tcltest* cmd {uplevel 1 $script} proc ::tcltest::EvalTest}} unset -nocomplain msg @@ -792,20 +792,20 @@ test info-23.3 {eval'd info frame, literal} -match glob -body { eval { info frame 0 } -} -result {type source line 793 file * cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type source line 793 file * cmd {info frame 0} proc ::tcltest::EvalTest} test info-23.4 {eval'd info frame, semi-dynamic} { eval info frame 0 -} {type eval line 1 cmd {info frame 0} proc ::tcltest::RunTest} +} {type eval line 1 cmd {info frame 0} proc ::tcltest::EvalTest} test info-23.5 {eval'd info frame, dynamic} -cleanup {unset script} -body { set script {info frame 0} eval $script -} -result {type eval line 1 cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type eval line 1 cmd {info frame 0} proc ::tcltest::EvalTest} test info-23.6 {eval'd info frame, trace} -match glob -cleanup {unset script} -body { set script {etrace} join [lrange [eval $script] 0 2] \n } -result {* {type source line 730 file info.test cmd {info frame $level} proc ::etrace level 0} -* {type eval line 1 cmd etrace proc ::tcltest::RunTest} -* {type source line 805 file info.test cmd {eval $script} proc ::tcltest::RunTest}} +* {type eval line 1 cmd etrace proc ::tcltest::EvalTest} +* {type source line 805 file info.test cmd {eval $script} proc ::tcltest::EvalTest}} # ------------------------------------------------------------------------- @@ -1024,7 +1024,7 @@ test info-30.0 {bs+nl in literal words} -cleanup {unset res} -body { # offsets of all bs+nl sequences in literal words, then using the # information in the bcc and other places to bump line numbers when # parsing over the location. Also affected: testcases 22.8 and 23.6. -} -result {type source line 1018 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type source line 1018 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} # ------------------------------------------------------------------------- # See 24.0 - 24.5 for similar situations, using literal scripts. @@ -1042,36 +1042,36 @@ test info-31.0 {ns eval, script in variable} -body {namespace eval foo {variable test info-31.1 {if, script in variable} -cleanup {unset res a flag} -body { if 1 $body return $res -} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::EvalTest} test info-31.1a {if, script in variable} -cleanup {unset res a flag} -body { if 1 then $body return $res -} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::EvalTest} test info-31.2 {while, script in variable} -cleanup {unset flag res a} -body { set flag 1 while {$flag} $body return $res -} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::EvalTest} # .3 - proc - scoping prevent return of result ... test info-31.4 {foreach, script in variable} -cleanup {unset var res a flag} -body { foreach var val $body set res -} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::EvalTest} test info-31.5 {for, script in variable} -cleanup {unset flag res a} -body { set flag 1 for {} {$flag} {} $body return $res -} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::EvalTest} test info-31.6 {eval, script in variable} -cleanup {unset res a flag} -body { eval $body return $res -} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type eval line 3 cmd {info frame 0} proc ::tcltest::EvalTest} # ------------------------------------------------------------------------- @@ -1319,8 +1319,8 @@ test info-37.0 {eval pure list, single line} -match glob -body { eval $cmd return $res } -result {* {type source line 730 file info.test cmd {info frame $level} proc ::etrace level 0} -* {type eval line 2 cmd etrace proc ::tcltest::RunTest} -* {type eval line 1 cmd foreac proc ::tcltest::RunTest}} -cleanup {unset foo cmd res b c} +* {type eval line 2 cmd etrace proc ::tcltest::EvalTest} +* {type eval line 1 cmd foreac proc ::tcltest::EvalTest}} -cleanup {unset foo cmd res b c} # ------------------------------------------------------------------------- @@ -1360,8 +1360,8 @@ test info-38.1 {location information for uplevel, dv, direct-var} -match glob -b } join [lrange [uplevel \#0 $script] 0 2] \n } -result {* {type source line 730 file info.test cmd {info frame $level} proc ::etrace level 0} -* {type eval line 3 cmd etrace proc ::tcltest::RunTest} -* {type source line 1361 file info.test cmd {uplevel \\#0 $script} proc ::tcltest::RunTest}} -cleanup {unset script y} +* {type eval line 3 cmd etrace proc ::tcltest::EvalTest} +* {type source line 1361 file info.test cmd {uplevel \\#0 $script} proc ::tcltest::EvalTest}} -cleanup {unset script y} # 38.2 moved to bottom to not disturb other tests with the necessary changes to this one. @@ -1381,7 +1381,7 @@ test info-38.3 {location information for uplevel, dpv, direct-proc-var} -match g } -result {* {type source line 730 file info.test cmd {info frame $level} proc ::etrace level 0} * {type eval line 3 cmd etrace proc ::control} * {type source line 1338 file info.test cmd {uplevel 1 $script} proc ::control} -* {type source line 1380 file info.test cmd {control y $script} proc ::tcltest::RunTest}} -cleanup {unset script y} +* {type source line 1380 file info.test cmd {control y $script} proc ::tcltest::EvalTest}} -cleanup {unset script y} # 38.4 moved to bottom to not disturb other tests with the necessary changes to this one. @@ -1399,7 +1399,7 @@ test info-38.5 {location information for uplevel, ppv, proc-proc-var} -match glo * {type eval line 3 cmd etrace proc ::control} * {type source line 1338 file info.test cmd {uplevel 1 $script} proc ::control} * {type source line 1353 file info.test cmd {control y $script} proc ::datav level 1} -* {type source line 1397 file info.test cmd datav proc ::tcltest::RunTest}} +* {type source line 1397 file info.test cmd datav proc ::tcltest::EvalTest}} # 38.6 moved to bottom to not disturb other tests with the necessary changes to this one. @@ -1413,9 +1413,9 @@ testConstraint testevalex [llength [info commands testevalex]] test info-38.7 {location information for arg substitution} -constraints testevalex -match glob -body { join [lrange [testevalex {return -level 0 [etrace]}] 0 3] \n } -result {* {type source line 730 file info.test cmd {info frame \$level} proc ::etrace level 0} -* {type eval line 1 cmd etrace proc ::tcltest::RunTest} -* {type source line 1414 file info.test cmd {testevalex {return -level 0 \[etrace]}} proc ::tcltest::RunTest} -* {type source line * file tcltest* cmd {uplevel 1 $script} proc ::tcltest::RunTest}} +* {type eval line 1 cmd etrace proc ::tcltest::EvalTest} +* {type source line 1414 file info.test cmd {testevalex {return -level 0 \[etrace]}} proc ::tcltest::EvalTest} +* {type source line * file tcltest* cmd {uplevel 1 $script} proc ::tcltest::EvalTest}} # ------------------------------------------------------------------------- # literal sharing @@ -1463,7 +1463,7 @@ test info-30.3 {bs+nl in literal words, namespace multi-word script} { namespace eval xxx variable res \ [list [reduce [info frame 0]]];# line 1464 return $xxx::res -} {type source line 1464 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {type source line 1464 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.4 {bs+nl in literal words, eval script} -cleanup {unset res} -body { eval { @@ -1471,7 +1471,7 @@ test info-30.4 {bs+nl in literal words, eval script} -cleanup {unset res} -body [reduce [info frame 0]];# line 1471 } return $res -} -result {type source line 1471 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type source line 1471 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.5 {bs+nl in literal words, eval script, with nested words} -body { eval { @@ -1482,12 +1482,12 @@ test info-30.5 {bs+nl in literal words, eval script, with nested words} -body { } } return $res -} -cleanup {unset res} -result {type source line 1481 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -cleanup {unset res} -result {type source line 1481 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.6 {bs+nl in computed word} -cleanup {unset res} -body { set res "\ [reduce [info frame 0]]";# line 1489 -} -result { type source line 1489 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -result { type source line 1489 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.7 {bs+nl in computed word, in proc} -body { proc abra {} { @@ -1505,7 +1505,7 @@ test info-30.8 {bs+nl in computed word, nested eval} -body { res "\ [reduce [info frame 0]]";# line 1506 } -} -cleanup {unset res} -result { type source line 1506 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -cleanup {unset res} -result { type source line 1506 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.9 {bs+nl in computed word, nested eval} -body { eval { @@ -1514,7 +1514,7 @@ test info-30.9 {bs+nl in computed word, nested eval} -body { [reduce \ [info frame 0]]";# line 1515 } -} -cleanup {unset res} -result { type source line 1515 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -cleanup {unset res} -result { type source line 1515 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.10 {bs+nl in computed word, key to array} -body { set tmp([set \ @@ -1523,14 +1523,14 @@ test info-30.10 {bs+nl in computed word, key to array} -body { [info frame 0]]"]) x ; #1523 unset tmp set res -} -cleanup {unset res} -result { type source line 1523 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -cleanup {unset res} -result { type source line 1523 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.11 {bs+nl in subst arguments} -body { subst {[set \ res "\ [reduce \ [info frame 0]]"]} ; #1532 -} -cleanup {unset res} -result { type source line 1532 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -cleanup {unset res} -result { type source line 1532 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.12 {bs+nl in computed word, nested eval} -body { eval { @@ -1540,7 +1540,7 @@ test info-30.12 {bs+nl in computed word, nested eval} -body { [reduce \ [info frame 0]]";# line 1541 } -} -cleanup {unset res x} -result { type source line 1541 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -cleanup {unset res x} -result { type source line 1541 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.13 {bs+nl in literal words, uplevel script, with nested words} -body { subinterp ; set res [interp eval sub { uplevel #0 { @@ -1601,7 +1601,7 @@ test info-30.17 {bs+nl in multi-body switch, direct} { ^key { reduce [info frame 0] ;# 1601 } \ \t### { } \ {[0-9]*} { } -} {type source line 1601 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {type source line 1601 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.18 {bs+nl, literal word, uplevel through proc, appended, loss of primary tracking data} { proc abra {script} { @@ -1644,7 +1644,7 @@ test info-30.20 {bs+nl in single-body switch, direct} { \t### { } {[0-9]*} { } } -} {type source line 1643 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {type source line 1643 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.21 {bs+nl in if, full compiled} { proc a {value} { @@ -1710,71 +1710,71 @@ type source line 1700 file info.test cmd {info frame 0} proc ::a level 0} test info-30.25 {TIP 280 for compiled [subst]} { subst {[reduce [info frame 0]]} ; # 1712 -} {type source line 1712 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {type source line 1712 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.26 {TIP 280 for compiled [subst]} { subst \ {[reduce [info frame 0]]} ; # 1716 -} {type source line 1716 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {type source line 1716 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.27 {TIP 280 for compiled [subst]} { subst { [reduce [info frame 0]]} ; # 1720 } { -type source line 1720 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +type source line 1720 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.28 {TIP 280 for compiled [subst]} { subst {\ [reduce [info frame 0]]} ; # 1725 -} { type source line 1725 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} { type source line 1725 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.29 {TIP 280 for compiled [subst]} { subst {foo\ [reduce [info frame 0]]} ; # 1729 -} {foo type source line 1729 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {foo type source line 1729 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.30 {TIP 280 for compiled [subst]} { subst {foo [reduce [info frame 0]]} ; # 1733 } {foo -type source line 1733 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +type source line 1733 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.31 {TIP 280 for compiled [subst]} { subst {[][reduce [info frame 0]]} ; # 1737 -} {type source line 1737 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {type source line 1737 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.32 {TIP 280 for compiled [subst]} { subst {[\ ][reduce [info frame 0]]} ; # 1741 -} {type source line 1741 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {type source line 1741 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.33 {TIP 280 for compiled [subst]} { subst {[ ][reduce [info frame 0]]} ; # 1745 -} {type source line 1745 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {type source line 1745 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.34 {TIP 280 for compiled [subst]} { subst {[format %s {} ][reduce [info frame 0]]} ; # 1749 -} {type source line 1749 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {type source line 1749 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.35 {TIP 280 for compiled [subst]} { subst {[format %s {} ] [reduce [info frame 0]]} ; # 1754 } { -type source line 1754 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +type source line 1754 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.36 {TIP 280 for compiled [subst]} { subst { [format %s {}][reduce [info frame 0]]} ; # 1759 } { -type source line 1759 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +type source line 1759 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.37 {TIP 280 for compiled [subst]} { subst { [format %s {}] [reduce [info frame 0]]} ; # 1765 } { -type source line 1765 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +type source line 1765 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.38 {TIP 280 for compiled [subst]} { subst {\ [format %s {}][reduce [info frame 0]]} ; # 1771 -} { type source line 1771 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} { type source line 1771 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.39 {TIP 280 for compiled [subst]} { subst {\ [format %s {}]\ [reduce [info frame 0]]} ; # 1776 -} { type source line 1776 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} { type source line 1776 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.40 {TIP 280 for compiled [subst]} -setup { unset -nocomplain empty } -body { @@ -1782,7 +1782,7 @@ test info-30.40 {TIP 280 for compiled [subst]} -setup { subst {$empty[reduce [info frame 0]]} ; # 1782 } -cleanup { unset empty -} -result {type source line 1782 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -result {type source line 1782 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.41 {TIP 280 for compiled [subst]} -setup { unset -nocomplain empty } -body { @@ -1792,7 +1792,7 @@ test info-30.41 {TIP 280 for compiled [subst]} -setup { } -cleanup { unset empty } -result { -type source line 1791 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +type source line 1791 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.42 {TIP 280 for compiled [subst]} -setup { unset -nocomplain empty } -body { @@ -1800,25 +1800,25 @@ test info-30.42 {TIP 280 for compiled [subst]} -setup { [reduce [info frame 0]]} ; # 1800 } -cleanup { unset empty -} -result { type source line 1800 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -result { type source line 1800 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.43 {TIP 280 for compiled [subst]} -body { unset -nocomplain a\nb set a\nb {} subst {${a b}[reduce [info frame 0]]} ; # 1808 -} -cleanup {unset a\nb} -result {type source line 1808 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} -cleanup {unset a\nb} -result {type source line 1808 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.44 {TIP 280 for compiled [subst]} { unset -nocomplain a set a(\n) {} subst {$a( )[reduce [info frame 0]]} ; # 1814 -} {type source line 1814 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {type source line 1814 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.45 {TIP 280 for compiled [subst]} { unset -nocomplain a set a() {} subst {$a([ return -level 0])[reduce [info frame 0]]} ; # 1820 -} {type source line 1820 file info.test cmd {info frame 0} proc ::tcltest::RunTest} +} {type source line 1820 file info.test cmd {info frame 0} proc ::tcltest::EvalTest} test info-30.46 {TIP 280 for compiled [subst]} { unset -nocomplain a set a(1825) YES; set a(1824) 1824; set a(1826) 1826 @@ -1835,7 +1835,7 @@ unset -nocomplain a test info-30.48 {Bug 2850901} testevalex { testevalex {return -level 0 [format %s {} ][reduce [info frame 0]]} ; # line 2 of the eval -} {type eval line 2 cmd {info frame 0} proc ::tcltest::RunTest} +} {type eval line 2 cmd {info frame 0} proc ::tcltest::EvalTest} # ------------------------------------------------------------------------- -- cgit v0.12 From db669f381b8ffe5ff42b0e4167f43e7db0f9e430 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 1 Dec 2019 21:25:32 +0000 Subject: Fix make install on Ubuntu (and - most likely - other platforms) --- unix/Makefile.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 5331c02..8123968 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -1026,7 +1026,10 @@ install-libraries: libraries $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \ done @echo "Installing package cookiejar 0.2 files to $(SCRIPT_INSTALL_DIR)/cookiejar0.2/" - @for i in $(TOP_DIR)/library/cookiejar/*.{tcl,txt.gz}; do \ + @for i in $(TOP_DIR)/library/cookiejar/*.tcl; do \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/cookiejar0.2; \ + done + @for i in $(TOP_DIR)/library/cookiejar/*.gz; do \ $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/cookiejar0.2; \ done @echo "Installing package http 2.9.1 as a Tcl Module" -- cgit v0.12 From f7e46677b5abeb96117fb80cbeba7526bc3b50d7 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 2 Dec 2019 10:47:00 +0000 Subject: Eliminate unneccessary eol-spacing from documentation. --- doc/break.n | 2 +- doc/case.n | 2 +- doc/cd.n | 2 +- doc/clock.n | 2 +- doc/close.n | 2 +- doc/concat.n | 2 +- doc/continue.n | 2 +- doc/copy.n | 6 +++--- doc/coroutine.n | 2 +- doc/eof.n | 2 +- doc/eval.n | 2 +- doc/exit.n | 2 +- doc/fblocked.n | 2 +- doc/flush.n | 2 +- doc/foreach.n | 2 +- doc/gets.n | 2 +- doc/history.n | 2 +- doc/if.n | 2 +- doc/incr.n | 2 +- doc/info.n | 2 +- doc/interp.n | 2 +- doc/join.n | 2 +- doc/lappend.n | 2 +- doc/lassign.n | 2 +- doc/list.n | 2 +- doc/load.n | 2 +- doc/lrepeat.n | 2 +- doc/lreverse.n | 2 +- doc/namespace.n | 2 +- doc/next.n | 2 +- doc/packagens.n | 2 +- doc/pid.n | 2 +- doc/platform.n | 2 +- doc/platform_shell.n | 2 +- doc/prefix.n | 2 +- doc/puts.n | 2 +- doc/pwd.n | 2 +- doc/refchan.n | 2 +- doc/registry.n | 2 +- doc/rename.n | 2 +- doc/seek.n | 2 +- doc/source.n | 2 +- doc/split.n | 2 +- doc/switch.n | 2 +- doc/tailcall.n | 2 +- doc/tell.n | 2 +- doc/throw.n | 2 +- doc/time.n | 2 +- doc/tm.n | 2 +- 49 files changed, 51 insertions(+), 51 deletions(-) diff --git a/doc/break.n b/doc/break.n index 3e4ce5f..78fd005 100644 --- a/doc/break.n +++ b/doc/break.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH break n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/case.n b/doc/case.n index 54d5bf4..c48d634 100644 --- a/doc/case.n +++ b/doc/case.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH case n 7.0 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/cd.n b/doc/cd.n index 67cdd17..dceb075 100644 --- a/doc/cd.n +++ b/doc/cd.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH cd n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/clock.n b/doc/clock.n index 6efa722..f0f6c37 100644 --- a/doc/clock.n +++ b/doc/clock.n @@ -465,7 +465,7 @@ a Daylight Saving Time change skips over that time, or an ambiguous time because a Daylight Saving Time change skips back so that the clock observes the given time twice, and no time zone specifier (\fB%z\fR or \fB%Z\fR) is present in the format, the time is interpreted as -if the clock had not changed. +if the clock had not changed. .SH "FORMAT GROUPS" .PP The following format groups are recognized by the \fBclock scan\fR and diff --git a/doc/close.n b/doc/close.n index 63da75b..5daf3e2 100644 --- a/doc/close.n +++ b/doc/close.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH close n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/concat.n b/doc/concat.n index 23c6c91..d10f092 100644 --- a/doc/concat.n +++ b/doc/concat.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH concat n 8.3 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/continue.n b/doc/continue.n index 17d16b4..92ff3b4 100644 --- a/doc/continue.n +++ b/doc/continue.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH continue n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/copy.n b/doc/copy.n index 789a76c..706be54 100644 --- a/doc/copy.n +++ b/doc/copy.n @@ -33,9 +33,9 @@ as the empty string, a new name is chosen. Names, unless specified, are chosen with the same algorithm used by the \fBnew\fR method of \fBoo::class\fR. .VE TIP473 -The copied object will be of the same class as the source object, and will have -all its per-object methods copied. If it is a class, it will also have all the -class methods in the class copied, but it will not have any of its instances +The copied object will be of the same class as the source object, and will have +all its per-object methods copied. If it is a class, it will also have all the +class methods in the class copied, but it will not have any of its instances copied. .PP .VS diff --git a/doc/coroutine.n b/doc/coroutine.n index c99f8d3..52775ef 100644 --- a/doc/coroutine.n +++ b/doc/coroutine.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH coroutine n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/eof.n b/doc/eof.n index 75f3c48..a150464 100644 --- a/doc/eof.n +++ b/doc/eof.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH eof n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/eval.n b/doc/eval.n index 3ef5023..9fc2ae4 100644 --- a/doc/eval.n +++ b/doc/eval.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH eval n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/exit.n b/doc/exit.n index 9b4ad20..a005c08 100644 --- a/doc/exit.n +++ b/doc/exit.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH exit n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/fblocked.n b/doc/fblocked.n index 2841aee..93cfe87 100644 --- a/doc/fblocked.n +++ b/doc/fblocked.n @@ -1,4 +1,4 @@ -'\" +'\" '\" Copyright (c) 1996 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution diff --git a/doc/flush.n b/doc/flush.n index d266d91..6b98ab7 100644 --- a/doc/flush.n +++ b/doc/flush.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH flush n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/foreach.n b/doc/foreach.n index 89a11f6..925ec1f 100644 --- a/doc/foreach.n +++ b/doc/foreach.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH foreach n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/gets.n b/doc/gets.n index 0150f29..57532c0 100644 --- a/doc/gets.n +++ b/doc/gets.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH gets n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/history.n b/doc/history.n index e1f9781..0391948 100644 --- a/doc/history.n +++ b/doc/history.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH history n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/if.n b/doc/if.n index 776f811..ff2518d 100644 --- a/doc/if.n +++ b/doc/if.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH if n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/incr.n b/doc/incr.n index 9052c5a..b4be95c 100644 --- a/doc/incr.n +++ b/doc/incr.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH incr n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/info.n b/doc/info.n index 1ad908d..477e272 100644 --- a/doc/info.n +++ b/doc/info.n @@ -7,7 +7,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH info n 8.4 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/interp.n b/doc/interp.n index 1c9618a..9fcd055 100644 --- a/doc/interp.n +++ b/doc/interp.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH interp n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/join.n b/doc/join.n index c8179bb..23a7697 100644 --- a/doc/join.n +++ b/doc/join.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH join n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/lappend.n b/doc/lappend.n index a324ca3..80d075a 100644 --- a/doc/lappend.n +++ b/doc/lappend.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lappend n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/lassign.n b/doc/lassign.n index e250729..5620de6 100644 --- a/doc/lassign.n +++ b/doc/lassign.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lassign n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/list.n b/doc/list.n index c2797f3..a182fc8 100644 --- a/doc/list.n +++ b/doc/list.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH list n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/load.n b/doc/load.n index 2ab8f2e..b592bb3 100644 --- a/doc/load.n +++ b/doc/load.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH load n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/lrepeat.n b/doc/lrepeat.n index 466339d..f92792e 100644 --- a/doc/lrepeat.n +++ b/doc/lrepeat.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lrepeat n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/lreverse.n b/doc/lreverse.n index 51a9e57..4c2f762 100644 --- a/doc/lreverse.n +++ b/doc/lreverse.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH lreverse n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/namespace.n b/doc/namespace.n index 1f4e85f..b0b6e25 100644 --- a/doc/namespace.n +++ b/doc/namespace.n @@ -303,7 +303,7 @@ used for qualified namespace or variable names. Sets or returns the unknown command handler for the current namespace. The handler is invoked when a command called from within the namespace cannot be found in the current namespace, the namespace's path nor in -the global namespace. +the global namespace. The \fIscript\fR argument, if given, should be a well formed list representing a command name and optional arguments. When the handler is invoked, the full invocation line will be appended to the diff --git a/doc/next.n b/doc/next.n index 62782e5..db846be 100644 --- a/doc/next.n +++ b/doc/next.n @@ -138,7 +138,7 @@ before chaining from subclass, args = x 1 2 3 y in the superclass, args = a x 1 2 3 y b in the superclass, args = pureSynthesis after chaining from subclass -before chaining from subclass, args = +before chaining from subclass, args = in the superclass, args = a b in the superclass, args = pureSynthesis after chaining from subclass diff --git a/doc/packagens.n b/doc/packagens.n index 61e7eca..5bd2e67 100644 --- a/doc/packagens.n +++ b/doc/packagens.n @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH pkg::create n 8.3 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/pid.n b/doc/pid.n index a4df2f3..6f8c399 100644 --- a/doc/pid.n +++ b/doc/pid.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH pid n 7.0 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/platform.n b/doc/platform.n index 6abc289..5380ff4 100644 --- a/doc/platform.n +++ b/doc/platform.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH "platform" n 1.0.4 platform "Tcl Bundled Packages" .so man.macros .BS diff --git a/doc/platform_shell.n b/doc/platform_shell.n index 64a2e46..330afa9 100644 --- a/doc/platform_shell.n +++ b/doc/platform_shell.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH "platform::shell" n 1.1.4 platform::shell "Tcl Bundled Packages" .so man.macros .BS diff --git a/doc/prefix.n b/doc/prefix.n index 344ade7..50aa2fb 100644 --- a/doc/prefix.n +++ b/doc/prefix.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH prefix n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/puts.n b/doc/puts.n index 01ca122..f4e1040 100644 --- a/doc/puts.n +++ b/doc/puts.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH puts n 7.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/pwd.n b/doc/pwd.n index 31d378f..85dd390 100644 --- a/doc/pwd.n +++ b/doc/pwd.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH pwd n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/refchan.n b/doc/refchan.n index 2232d50..8737556 100644 --- a/doc/refchan.n +++ b/doc/refchan.n @@ -1,4 +1,4 @@ -'\" +'\" '\" Copyright (c) 2006 Andreas Kupries '\" '\" See the file "license.terms" for information on usage and redistribution diff --git a/doc/registry.n b/doc/registry.n index 001def9..ec5910c 100644 --- a/doc/registry.n +++ b/doc/registry.n @@ -152,7 +152,7 @@ nulls. .TP \fBsz\fR . -The registry value contains a null-terminated string. The data is +The registry value contains a null-terminated string. The data is represented in Tcl as a string. .TP \fBexpand_sz\fR diff --git a/doc/rename.n b/doc/rename.n index 744bf5a..f74db5f 100644 --- a/doc/rename.n +++ b/doc/rename.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH rename n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/seek.n b/doc/seek.n index 02c5341..3b206d1 100644 --- a/doc/seek.n +++ b/doc/seek.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH seek n 8.1 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/source.n b/doc/source.n index 67d4b6b..82fefa6 100644 --- a/doc/source.n +++ b/doc/source.n @@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH source n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/split.n b/doc/split.n index f1c66d0..e977d7c 100644 --- a/doc/split.n +++ b/doc/split.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH split n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/switch.n b/doc/switch.n index 6e27f56..70eeb09 100644 --- a/doc/switch.n +++ b/doc/switch.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH switch n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/tailcall.n b/doc/tailcall.n index 926c608..24eb902 100644 --- a/doc/tailcall.n +++ b/doc/tailcall.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tailcall n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/tell.n b/doc/tell.n index e8bf3af..1da240d 100644 --- a/doc/tell.n +++ b/doc/tell.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tell n 8.1 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/throw.n b/doc/throw.n index 0d1df78..0d096f4 100644 --- a/doc/throw.n +++ b/doc/throw.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH throw n 8.6 Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/time.n b/doc/time.n index 35b41c4..bea974f 100644 --- a/doc/time.n +++ b/doc/time.n @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH time n "" Tcl "Tcl Built-In Commands" .so man.macros .BS diff --git a/doc/tm.n b/doc/tm.n index 5602686..d5c3cc7 100644 --- a/doc/tm.n +++ b/doc/tm.n @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tm n 8.5 Tcl "Tcl Built-In Commands" .so man.macros .BS -- cgit v0.12 From d6a3244d183bd99ddc7ab3f9265f48d66fe8f0b5 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 2 Dec 2019 10:48:01 +0000 Subject: More eol-spacing --- doc/CallDel.3 | 2 +- doc/CmdCmplt.3 | 2 +- doc/Concat.3 | 2 +- doc/CrtFileHdlr.3 | 2 +- doc/CrtInterp.3 | 2 +- doc/CrtTimerHdlr.3 | 2 +- doc/DetachPids.3 | 2 +- doc/DictObj.3 | 2 +- doc/DoWhenIdle.3 | 2 +- doc/Environment.3 | 2 +- doc/ExprLongObj.3 | 2 +- doc/FindExec.3 | 2 +- doc/GetCwd.3 | 2 +- doc/GetIndex.3 | 2 +- doc/GetOpnFl.3 | 2 +- doc/GetTime.3 | 2 +- doc/Init.3 | 2 +- doc/InitStubs.3 | 2 +- doc/Limit.3 | 2 +- doc/Load.3 | 2 +- doc/NRE.3 | 2 +- doc/Namespace.3 | 4 ++-- doc/OpenTcp.3 | 2 +- doc/Preserve.3 | 2 +- doc/PrintDbl.3 | 2 +- doc/RecEvalObj.3 | 2 +- doc/RecordEval.3 | 2 +- doc/SetErrno.3 | 2 +- doc/SetRecLmt.3 | 2 +- doc/Signal.3 | 2 +- doc/Sleep.3 | 2 +- doc/SplitList.3 | 2 +- doc/SplitPath.3 | 2 +- doc/StaticPkg.3 | 2 +- doc/StdChannels.3 | 2 +- doc/StrMatch.3 | 2 +- doc/SubstObj.3 | 2 +- doc/TCL_MEM_DEBUG.3 | 4 ++-- doc/TclZlib.3 | 2 +- doc/tclsh.1 | 2 +- 40 files changed, 42 insertions(+), 42 deletions(-) diff --git a/doc/CallDel.3 b/doc/CallDel.3 index 766621a..33b8afc 100644 --- a/doc/CallDel.3 +++ b/doc/CallDel.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CallWhenDeleted 3 7.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/CmdCmplt.3 b/doc/CmdCmplt.3 index 25b372e..bb7532c 100644 --- a/doc/CmdCmplt.3 +++ b/doc/CmdCmplt.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CommandComplete 3 "" Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Concat.3 b/doc/Concat.3 index 58a0fb6..e853fc3 100644 --- a/doc/Concat.3 +++ b/doc/Concat.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Concat 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/CrtFileHdlr.3 b/doc/CrtFileHdlr.3 index c1bc1fa..f1b8df7 100644 --- a/doc/CrtFileHdlr.3 +++ b/doc/CrtFileHdlr.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CreateFileHandler 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/CrtInterp.3 b/doc/CrtInterp.3 index 679795e..1d49158 100644 --- a/doc/CrtInterp.3 +++ b/doc/CrtInterp.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CreateInterp 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/CrtTimerHdlr.3 b/doc/CrtTimerHdlr.3 index f3957c7..c229a23 100644 --- a/doc/CrtTimerHdlr.3 +++ b/doc/CrtTimerHdlr.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_CreateTimerHandler 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/DetachPids.3 b/doc/DetachPids.3 index 39a51d3..26075c3 100644 --- a/doc/DetachPids.3 +++ b/doc/DetachPids.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_DetachPids 3 "" Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/DictObj.3 b/doc/DictObj.3 index 90ca9e3..2c111c4 100644 --- a/doc/DictObj.3 +++ b/doc/DictObj.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_DictObj 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/DoWhenIdle.3 b/doc/DoWhenIdle.3 index 3e28b4d..cfdbff9 100644 --- a/doc/DoWhenIdle.3 +++ b/doc/DoWhenIdle.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_DoWhenIdle 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Environment.3 b/doc/Environment.3 index 85880b4..7a5e396 100644 --- a/doc/Environment.3 +++ b/doc/Environment.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_PutEnv 3 "7.5" Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/ExprLongObj.3 b/doc/ExprLongObj.3 index 35edb5f..837e0a8 100644 --- a/doc/ExprLongObj.3 +++ b/doc/ExprLongObj.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_ExprLongObj 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/FindExec.3 b/doc/FindExec.3 index b01315c..1fd57db 100644 --- a/doc/FindExec.3 +++ b/doc/FindExec.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_FindExecutable 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/GetCwd.3 b/doc/GetCwd.3 index 58abcde..f4f37a1 100644 --- a/doc/GetCwd.3 +++ b/doc/GetCwd.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetCwd 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/GetIndex.3 b/doc/GetIndex.3 index fc6f40b..17a31d4 100644 --- a/doc/GetIndex.3 +++ b/doc/GetIndex.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetIndexFromObj 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/GetOpnFl.3 b/doc/GetOpnFl.3 index 86d1b94..a450b02 100644 --- a/doc/GetOpnFl.3 +++ b/doc/GetOpnFl.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetOpenFile 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/GetTime.3 b/doc/GetTime.3 index 6b885ee..9f96be5 100644 --- a/doc/GetTime.3 +++ b/doc/GetTime.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_GetTime 3 8.4 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Init.3 b/doc/Init.3 index 33c27a3..0a6635e 100644 --- a/doc/Init.3 +++ b/doc/Init.3 @@ -1,7 +1,7 @@ '\" '\" Copyright (c) 1998-2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH Tcl_Init 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/InitStubs.3 b/doc/InitStubs.3 index 73c3437..fbb3f56 100644 --- a/doc/InitStubs.3 +++ b/doc/InitStubs.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_InitStubs 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Limit.3 b/doc/Limit.3 index 20a2e02..5939a80 100644 --- a/doc/Limit.3 +++ b/doc/Limit.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_LimitCheck 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Load.3 b/doc/Load.3 index 0ffaf57..1d0d738 100644 --- a/doc/Load.3 +++ b/doc/Load.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Load 3 8.6 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/NRE.3 b/doc/NRE.3 index 6078a53..6024b6a 100644 --- a/doc/NRE.3 +++ b/doc/NRE.3 @@ -1,6 +1,6 @@ .\" .\" Copyright (c) 2008 by Kevin B. Kenny. -.\" Copyright (c) 2018 by Nathan Coulter. +.\" Copyright (c) 2018 by Nathan Coulter. .\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/doc/Namespace.3 b/doc/Namespace.3 index be89597..a037442 100644 --- a/doc/Namespace.3 +++ b/doc/Namespace.3 @@ -3,10 +3,10 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" '\" Note that some of these functions do not seem to belong, but they '\" were all introduced with the same TIP (#139) -'\" +'\" .TH Tcl_Namespace 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/OpenTcp.3 b/doc/OpenTcp.3 index 9fe2615..4a7dc1e 100644 --- a/doc/OpenTcp.3 +++ b/doc/OpenTcp.3 @@ -130,7 +130,7 @@ for the new channel, \fIhostName\fR points to a string containing the name of the client host making the connection, and \fIport\fR will contain the client's port number. The new channel -is opened for both input and output. +is opened for both input and output. If \fIproc\fR raises an error, the connection is closed automatically. \fIProc\fR has no return value, but if it wishes to reject the connection it can close \fIchannel\fR. diff --git a/doc/Preserve.3 b/doc/Preserve.3 index 970bded..c8f34a2 100644 --- a/doc/Preserve.3 +++ b/doc/Preserve.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Preserve 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/PrintDbl.3 b/doc/PrintDbl.3 index 730794f..896b6eb 100644 --- a/doc/PrintDbl.3 +++ b/doc/PrintDbl.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_PrintDouble 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/RecEvalObj.3 b/doc/RecEvalObj.3 index 387cc44..1b0f292 100644 --- a/doc/RecEvalObj.3 +++ b/doc/RecEvalObj.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_RecordAndEvalObj 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/RecordEval.3 b/doc/RecordEval.3 index e1625ff..36ef6b9 100644 --- a/doc/RecordEval.3 +++ b/doc/RecordEval.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_RecordAndEval 3 7.4 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/SetErrno.3 b/doc/SetErrno.3 index 21648b1..c202e2e 100644 --- a/doc/SetErrno.3 +++ b/doc/SetErrno.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SetErrno 3 8.3 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/SetRecLmt.3 b/doc/SetRecLmt.3 index 904d4ab..ec55794 100644 --- a/doc/SetRecLmt.3 +++ b/doc/SetRecLmt.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SetRecursionLimit 3 7.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Signal.3 b/doc/Signal.3 index 70b9d91..0a280f9 100644 --- a/doc/Signal.3 +++ b/doc/Signal.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SignalId 3 8.3 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/Sleep.3 b/doc/Sleep.3 index 2d36697..656d72a 100644 --- a/doc/Sleep.3 +++ b/doc/Sleep.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_Sleep 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/SplitList.3 b/doc/SplitList.3 index 3439f2e..d19ca14 100644 --- a/doc/SplitList.3 +++ b/doc/SplitList.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SplitList 3 8.0 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/SplitPath.3 b/doc/SplitPath.3 index 19cee05..c011194 100644 --- a/doc/SplitPath.3 +++ b/doc/SplitPath.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SplitPath 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/StaticPkg.3 b/doc/StaticPkg.3 index 5700ea7..41e2d65 100644 --- a/doc/StaticPkg.3 +++ b/doc/StaticPkg.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_StaticPackage 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/StdChannels.3 b/doc/StdChannels.3 index 651ad7d..7cb75a0 100644 --- a/doc/StdChannels.3 +++ b/doc/StdChannels.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH "Standard Channels" 3 7.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/StrMatch.3 b/doc/StrMatch.3 index f9c2be3..d664067 100644 --- a/doc/StrMatch.3 +++ b/doc/StrMatch.3 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_StringMatch 3 8.5 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/SubstObj.3 b/doc/SubstObj.3 index f582c5a..a2b6214 100644 --- a/doc/SubstObj.3 +++ b/doc/SubstObj.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH Tcl_SubstObj 3 8.4 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/TCL_MEM_DEBUG.3 b/doc/TCL_MEM_DEBUG.3 index e3a6809..3a014d4 100644 --- a/doc/TCL_MEM_DEBUG.3 +++ b/doc/TCL_MEM_DEBUG.3 @@ -1,8 +1,8 @@ -'\" +'\" '\" Copyright (c) 1992-1999 Karl Lehenbauer and Mark Diekhans. '\" Copyright (c) 2000 by Scriptics Corporation. '\" All rights reserved. -'\" +'\" .TH TCL_MEM_DEBUG 3 8.1 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/TclZlib.3 b/doc/TclZlib.3 index c6a6417..4a5df89 100644 --- a/doc/TclZlib.3 +++ b/doc/TclZlib.3 @@ -3,7 +3,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH TclZlib 3 8.6 Tcl "Tcl Library Procedures" .so man.macros .BS diff --git a/doc/tclsh.1 b/doc/tclsh.1 index 6ed5eb6..0e59b4f 100644 --- a/doc/tclsh.1 +++ b/doc/tclsh.1 @@ -4,7 +4,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH tclsh 1 "" Tcl "Tcl Applications" .so man.macros .BS -- cgit v0.12 From 90493b40122f01179e4f0152f055e44631b10e22 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 2 Dec 2019 10:49:11 +0000 Subject: Renumber tcltest from 2.5.1 -> 2.5.2, already for next release. --- library/tcltest/pkgIndex.tcl | 2 +- library/tcltest/tcltest.tcl | 2 +- unix/Makefile.in | 4 ++-- win/Makefile.in | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/tcltest/pkgIndex.tcl b/library/tcltest/pkgIndex.tcl index ca93725..4aa3970 100644 --- a/library/tcltest/pkgIndex.tcl +++ b/library/tcltest/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.5-]} {return} -package ifneeded tcltest 2.5.1 [list source [file join $dir tcltest.tcl]] +package ifneeded tcltest 2.5.2 [list source [file join $dir tcltest.tcl]] diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 67a8eb6..4171965 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -22,7 +22,7 @@ namespace eval tcltest { # When the version number changes, be sure to update the pkgIndex.tcl file, # and the install directory in the Makefiles. When the minor version # changes (new feature) be sure to update the man page as well. - variable Version 2.5.1 + variable Version 2.5.2 # Compatibility support for dumb variables defined in tcltest 1 # Do not use these. Call [package provide Tcl] and [info patchlevel] diff --git a/unix/Makefile.in b/unix/Makefile.in index 99bdf05..69f7e90 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -947,8 +947,8 @@ install-libraries: libraries done; @echo "Installing package msgcat 1.6.1 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.6.1.tm; - @echo "Installing package tcltest 2.5.1 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.5.1.tm; + @echo "Installing package tcltest 2.5.2 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.5.2.tm; @echo "Installing package platform 1.0.14 as a Tcl Module"; @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.14.tm; diff --git a/win/Makefile.in b/win/Makefile.in index d24575f..0c24278 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -714,8 +714,8 @@ install-libraries: libraries install-tzdata install-msgs done; @echo "Installing package msgcat 1.6.1 as a Tcl Module"; @$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.6.1.tm; - @echo "Installing package tcltest 2.5.1 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.5.1.tm; + @echo "Installing package tcltest 2.5.2 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.5.2.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"; -- cgit v0.12 From 8e1f9bb6d10b8e3a492a329e0476238c4893e96f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 2 Dec 2019 10:58:19 +0000 Subject: Eliminate excess eol-spacing --- changes | 4 ++-- generic/tcl.h | 2 +- generic/tclEncoding.c | 2 +- generic/tclIOUtil.c | 40 ++++++++++++++++++++-------------------- generic/tclPathObj.c | 6 +++--- generic/tclScan.c | 2 +- unix/tclUnixFCmd.c | 6 +++--- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/changes b/changes index bf50b63..ba880ee 100644 --- a/changes +++ b/changes @@ -9024,11 +9024,11 @@ in this changeset (new minor version) rather than bug fixes: 2018-02-14 [TIP 476] Scan/Printf consistency (nijtmans) -2018-03-05 [TIP 351] [lsearch] striding +2018-03-05 [TIP 351] [lsearch] striding 2018-03-05 [TIPs 330,336] tighten access to Interp fields (porter) -2018-03-12 [TIP 462] [::tcl::process] +2018-03-12 [TIP 462] [::tcl::process] 2018-03-12 [TIP 490] add oo support for msgcat => msgcat 1.7.0 (oehlmann) diff --git a/generic/tcl.h b/generic/tcl.h index e26097e..697a95f 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -1729,7 +1729,7 @@ typedef struct Tcl_Filesystem { * arbitrary additional data to files in a * filesystem. */ Tcl_FSFileAttrsGetProc *fileAttrsGetProc; - /* Called by 'Tcl_FSFileAttrsGet()' and by + /* Called by 'Tcl_FSFileAttrsGet()' and by * 'file attributes'. */ Tcl_FSFileAttrsSetProc *fileAttrsSetProc; /* Called by 'Tcl_FSFileAttrsSet()' and by diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index e318d5b..cf738ed 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -1721,7 +1721,7 @@ LoadEncodingFile( * not be created because the file contained invalid data. * * Side effects: - * See Tcl_CreateEncoding(). + * See Tcl_CreateEncoding(). * *------------------------------------------------------------------------- */ diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index ceee36e..28e1df5 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -620,7 +620,7 @@ FsGetFirstFilesystem(void) } /* - * The epoch can is changed when a filesystems is added or removed, when + * The epoch can is changed when a filesystems is added or removed, when * "system encoding" changes, and when env(HOME) changes. */ @@ -959,7 +959,7 @@ Tcl_FSUnregister( * Search in the given pathname for files matching the given pattern. * Used by [glob]. Processes just one pattern for one directory. Callers * such as TclGlob and DoGlob implement manage the searching of multiple - * directories in cases such as + * directories in cases such as * glob -dir $dir -join * pkgIndex.tcl * * Results: @@ -1222,7 +1222,7 @@ FsAddMountsToGlobResult( * * The reason for the exception in 2,3 for the native filesystem is that * the native filesystem claims every file without determining whether - * whether the file exists, or even whether the pathname makes sense. + * whether the file exists, or even whether the pathname makes sense. * *---------------------------------------------------------------------- */ @@ -1240,7 +1240,7 @@ Tcl_FSMountsChanged( /* * Increment the filesystem epoch to invalidate every existing cached - * internal representation. + * internal representation. */ Tcl_MutexLock(&filesystemMutex); @@ -1475,7 +1475,7 @@ TclGetOpenModeEx( const char *modeString, /* Mode string, e.g. "r+" or "RDONLY CREAT" */ int *seekFlagPtr, /* Sets this to 1 to tell the the caller to seek to * EOF after opening the file, and 0 otherwise. */ - int *binaryPtr) /* Sets this to 1 to tell the caller to + int *binaryPtr) /* Sets this to 1 to tell the caller to * configure the channel for binary * operations after opening the file. */ { @@ -1718,7 +1718,7 @@ Tcl_FSEvalFileEx( } /* - * The eof character is \32 (^Z). This is standard on Windows, and Tcl + * The eof character is \32 (^Z). This is standard on Windows, and Tcl * uses it on every platform to allow for scripted documents. [Bug: 2040] */ @@ -1854,7 +1854,7 @@ TclNREvalFile( TclPkgFileSeen(interp, Tcl_GetString(pathPtr)); /* - * The eof character is \32 (^Z). This is standard on Windows, and Tcl + * The eof character is \32 (^Z). This is standard on Windows, and Tcl * uses it on every platform to allow for scripted documents. [Bug: 2040] */ @@ -2064,7 +2064,7 @@ Tcl_PosixError( *---------------------------------------------------------------------- * * Tcl_FSStat -- - * Calls 'statProc' of the filesystem corresponding to pathPtr. + * Calls 'statProc' of the filesystem corresponding to pathPtr. * * Replaces the standard library routines stat. * @@ -2098,7 +2098,7 @@ Tcl_FSStat( *---------------------------------------------------------------------- * * Tcl_FSLstat -- - * Calls the 'lstatProc' of the filesystem corresponding to pathPtr. + * Calls the 'lstatProc' of the filesystem corresponding to pathPtr. * * Replaces the library version of lstat. If the filesystem doesn't * provide lstatProc but does provide statProc, Tcl falls back to @@ -2198,7 +2198,7 @@ Tcl_FSOpenFileChannel( if (Tcl_FSGetNormalizedPath(interp, pathPtr) == NULL) { /* - * Return the correct error message. + * Return the correct error message. */ return NULL; } @@ -2650,7 +2650,7 @@ Tcl_FSGetCwd( norm = TclFSNormalizeAbsolutePath(interp,retVal); if (norm != NULL) { /* - * Assign to global storage the pathname of the current directory + * Assign to global storage the pathname of the current directory * and copy it into thread-local storage as well. * * At system startup multiple threads could in principle @@ -2953,7 +2953,7 @@ Tcl_FSChdir( */ FsUpdateCwd(normDirName, cd); - } + } } else { /* * Tcl_FSGetCwd() synchronizes the file-global cwdPathPtr if @@ -3017,7 +3017,7 @@ Tcl_FSLoadFile( /* Places to store pointers to the functions * named by sym1 and sym2. */ Tcl_LoadHandle *handlePtr, /* A place to store the token for the loaded - * object. Can be passed to + * object. Can be passed to * (*unloadProcPtr)() to unload the file. */ Tcl_FSUnloadFileProc **unloadProcPtr) /* A place to store a pointer to the function @@ -3049,7 +3049,7 @@ Tcl_FSLoadFile( * * Load a dynamic shared object by calling 'loadFileProc' of the * filesystem corresponding to the given pathname, and then finds within - * the loaded object the functions named in symbols[]. + * the loaded object the functions named in symbols[]. * * The given pathname is passed unmodified to `loadFileProc`, which * decides how to resolve it. On POSIX systems the native filesystem @@ -3194,7 +3194,7 @@ Tcl_LoadFile( } /* - * The filesystem doesn't support 'load'. Fall to the following: + * The filesystem doesn't support 'load'. Fall to the following: */ /* @@ -3377,7 +3377,7 @@ Tcl_LoadFile( /* * This is the filesystem for the temporary file the object was loaded * from. A reference to copyToPtr is already stored in - * tvdlPtr->divertedFile, so need need to increment the refCount again. + * tvdlPtr->divertedFile, so need need to increment the refCount again. */ tvdlPtr->divertedFilesystem = copyFsPtr; @@ -3720,7 +3720,7 @@ TclFSUnloadTempFile( Tcl_Obj * Tcl_FSLink( Tcl_Obj *pathPtr, /* Pathaname of file. */ - Tcl_Obj *toPtr, /* + Tcl_Obj *toPtr, /* * NULL or the pathname of a file to link to. */ int linkAction) /* Action to perform. */ @@ -3803,7 +3803,7 @@ Tcl_FSListVolumes(void) * * FsListMounts -- * - * Lists the mounts mathing the given pattern in the given directory. + * Lists the mounts mathing the given pattern in the given directory. * * Results: * A list, having a refCount of 0, of the matching mounts, or NULL if no @@ -4208,7 +4208,7 @@ Tcl_FSCopyFile( * TclCrossFilesystemCopy -- * * Helper for Tcl_FSCopyFile and Tcl_FSLoadFile. Copies a file from one - * filesystem to another, overwiting any file that already exists. + * filesystem to another, overwiting any file that already exists. * * Results: * A standard Tcl return code. @@ -4513,7 +4513,7 @@ Tcl_FSGetFileSystemForPath( /* * Call each of the "pathInFilesystem" functions in succession until the * corresponding filesystem is found. - */ + */ for (; fsRecPtr!=NULL ; fsRecPtr=fsRecPtr->nextPtr) { ClientData clientData = NULL; diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index 660db03..13b7768 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -47,7 +47,7 @@ static const Tcl_ObjType fsPathType = { /* * struct FsPath -- * - * Internal representation of a Tcl_Obj of fsPathType + * Internal representation of a Tcl_Obj of fsPathType */ typedef struct FsPath { @@ -124,7 +124,7 @@ typedef struct FsPath { * None (beyond the memory allocation for the result). * * Special note: - * Originally based on code from Matt Newman and Jean-Claude Wippler. + * Originally based on code from Matt Newman and Jean-Claude Wippler. * Totally rewritten later by Vince Darley to handle symbolic links. * *--------------------------------------------------------------------------- @@ -2028,7 +2028,7 @@ Tcl_FSGetInternalRep( * * TclFSEnsureEpochOk -- * - * Ensure that the path is a valid path, and that it has a + * Ensure that the path is a valid path, and that it has a * fsPathType internal representation that is not stale. * * Results: diff --git a/generic/tclScan.c b/generic/tclScan.c index 5edbffa..5916137 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -935,7 +935,7 @@ Tcl_ScanObjCmd( Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); return TCL_ERROR; } else { - mp_set_ull(&big, (Tcl_WideUInt)wideValue); + mp_set_ull(&big, (Tcl_WideUInt)wideValue); Tcl_SetBignumObj(objPtr, &big); } } else { diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 3fdf95a..62fd9f8 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -2035,7 +2035,7 @@ TclpObjNormalizePath( } /* - * Call 'realpath' to obtain a canonical path. + * Call 'realpath' to obtain a canonical path. */ #ifndef NO_REALPATH @@ -2045,7 +2045,7 @@ TclpObjNormalizePath( * The path contains at most one component, e.g. '/foo' or '/', so * so there is nothing to resolve. Also, on some platforms * 'Realpath' transforms an empty string into the normalized pwd, - * which is the wrong answer. + * which is the wrong answer. */ return 0; @@ -2091,7 +2091,7 @@ TclpObjNormalizePath( if (path[nextCheckpoint] != '\0') { /* - * Append the remaining path components. + * Append the remaining path components. */ int normLen = Tcl_DStringLength(&ds); -- cgit v0.12 From eadbf37f4ed564898bded872b36eb24e657509ac Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 2 Dec 2019 13:28:46 +0000 Subject: Fix [a46a49b90f]: tests http-cookiejar-1.[12] fail --- tests/httpcookie.test | 122 +++++++++++++++++++++++++------------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/tests/httpcookie.test b/tests/httpcookie.test index a6b193f..b3c5412 100644 --- a/tests/httpcookie.test +++ b/tests/httpcookie.test @@ -25,48 +25,48 @@ testConstraint cookiejar [expr {[testConstraint sqlite3] && ![catch { package require cookiejar }]}] -set COOKIEJAR_VERSION 0.1 -test http-cookiejar-1.1 "cookie storage: packaging" {notOSXtravis sqlite3 cookiejar} { +set COOKIEJAR_VERSION 0.2.0 +test http-cookiejar-1.1 "cookie storage: packaging" {cookiejar} { package require cookiejar } $COOKIEJAR_VERSION -test http-cookiejar-1.2 "cookie storage: packaging" {notOSXtravis sqlite3 cookiejar} { +test http-cookiejar-1.2 "cookie storage: packaging" {cookiejar} { package require cookiejar package require cookiejar } $COOKIEJAR_VERSION test http-cookiejar-2.1 "cookie storage: basics" -constraints { - notOSXtravis sqlite3 cookiejar + cookiejar } -returnCodes error -body { http::cookiejar } -result {wrong # args: should be "http::cookiejar method ?arg ...?"} test http-cookiejar-2.2 "cookie storage: basics" -constraints { - notOSXtravis sqlite3 cookiejar + cookiejar } -returnCodes error -body { http::cookiejar ? } -result {unknown method "?": must be configure, create, destroy or new} test http-cookiejar-2.3 "cookie storage: basics" -constraints { - notOSXtravis sqlite3 cookiejar + cookiejar } -body { http::cookiejar configure } -result {-domainfile -domainlist -domainrefresh -loglevel -offline -purgeold -retain -vacuumtrigger} test http-cookiejar-2.4 "cookie storage: basics" -constraints { - notOSXtravis sqlite3 cookiejar + cookiejar } -returnCodes error -body { http::cookiejar configure a b c d e } -result {wrong # args: should be "http::cookiejar configure ?optionName? ?optionValue?"} test http-cookiejar-2.5 "cookie storage: basics" -constraints { - notOSXtravis sqlite3 cookiejar + cookiejar } -returnCodes error -body { http::cookiejar configure a } -result {bad option "a": must be -domainfile, -domainlist, -domainrefresh, -loglevel, -offline, -purgeold, -retain, or -vacuumtrigger} test http-cookiejar-2.6 "cookie storage: basics" -constraints { - notOSXtravis sqlite3 cookiejar + cookiejar } -returnCodes error -body { http::cookiejar configure -d } -result {ambiguous option "-d": must be -domainfile, -domainlist, -domainrefresh, -loglevel, -offline, -purgeold, -retain, or -vacuumtrigger} test http-cookiejar-2.7 "cookie storage: basics" -setup { set old [http::cookiejar configure -loglevel] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { list [http::cookiejar configure -loglevel] \ [http::cookiejar configure -loglevel debug] \ [http::cookiejar configure -loglevel] \ @@ -77,7 +77,7 @@ test http-cookiejar-2.7 "cookie storage: basics" -setup { } -result {info debug debug error error} test http-cookiejar-2.8 "cookie storage: basics" -setup { set old [http::cookiejar configure -loglevel] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { list [http::cookiejar configure -loglevel] \ [http::cookiejar configure -loglevel d] \ [http::cookiejar configure -loglevel i] \ @@ -88,38 +88,38 @@ test http-cookiejar-2.8 "cookie storage: basics" -setup { } -result {info debug info warn error} test http-cookiejar-2.9 "cookie storage: basics" -body { http::cookiejar configure -off -} -constraints {notOSXtravis sqlite3 cookiejar} -match glob -result * +} -constraints {cookiejar} -match glob -result * test http-cookiejar-2.10 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -offline] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar configure -offline true } -cleanup { catch {http::cookiejar configure -offline $oldval} } -result 1 test http-cookiejar-2.11 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -offline] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar configure -offline nonbool } -cleanup { catch {http::cookiejar configure -offline $oldval} } -returnCodes error -result {expected boolean value but got "nonbool"} test http-cookiejar-2.12 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -purgeold] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar configure -purge nonint } -cleanup { catch {http::cookiejar configure -purgeold $oldval} } -returnCodes error -result {expected positive integer but got "nonint"} test http-cookiejar-2.13 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -domainrefresh] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar configure -domainref nonint } -cleanup { catch {http::cookiejar configure -domainrefresh $oldval} } -returnCodes error -result {expected positive integer but got "nonint"} test http-cookiejar-2.14 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -domainrefresh] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar configure -domainref -42 } -cleanup { catch {http::cookiejar configure -domainrefresh $oldval} @@ -128,7 +128,7 @@ test http-cookiejar-2.15 "cookie storage: basics" -setup { set oldval [http::cookiejar configure -domainrefresh] set result unset set tracer [http::cookiejar create tracer] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { oo::objdefine $tracer method PostponeRefresh {} { set ::result set next @@ -140,28 +140,28 @@ test http-cookiejar-2.15 "cookie storage: basics" -setup { catch {http::cookiejar configure -domainrefresh $oldval} } -result set -test http-cookiejar-3.1 "cookie storage: class" {notOSXtravis sqlite3 cookiejar} { +test http-cookiejar-3.1 "cookie storage: class" {cookiejar} { info object isa object http::cookiejar } 1 -test http-cookiejar-3.2 "cookie storage: class" {notOSXtravis sqlite3 cookiejar} { +test http-cookiejar-3.2 "cookie storage: class" {cookiejar} { info object isa class http::cookiejar } 1 -test http-cookiejar-3.3 "cookie storage: class" {notOSXtravis sqlite3 cookiejar} { +test http-cookiejar-3.3 "cookie storage: class" {cookiejar} { lsort [info object methods http::cookiejar] } {configure} -test http-cookiejar-3.4 "cookie storage: class" {notOSXtravis sqlite3 cookiejar} { +test http-cookiejar-3.4 "cookie storage: class" {cookiejar} { lsort [info object methods http::cookiejar -all] } {configure create destroy new} test http-cookiejar-3.5 "cookie storage: class" -setup { catch {rename ::cookiejar ""} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { namespace eval :: {http::cookiejar create cookiejar} } -cleanup { catch {rename ::cookiejar ""} } -result ::cookiejar test http-cookiejar-3.6 "cookie storage: class" -setup { catch {rename ::cookiejar ""} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { list [http::cookiejar create ::cookiejar] [info commands ::cookiejar] \ [::cookiejar destroy] [info commands ::cookiejar] } -cleanup { @@ -169,7 +169,7 @@ test http-cookiejar-3.6 "cookie storage: class" -setup { } -result {::cookiejar ::cookiejar {} {}} test http-cookiejar-3.7 "cookie storage: class" -setup { catch {rename ::cookiejar ""} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar create ::cookiejar foo bar } -returnCodes error -cleanup { catch {rename ::cookiejar ""} @@ -178,7 +178,7 @@ test http-cookiejar-3.8 "cookie storage: class" -setup { catch {rename ::cookiejar ""} set f [makeFile "" cookiejar] file delete $f -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { list [file exists $f] [http::cookiejar create ::cookiejar $f] \ [file exists $f] } -cleanup { @@ -188,7 +188,7 @@ test http-cookiejar-3.8 "cookie storage: class" -setup { test http-cookiejar-3.9 "cookie storage: class" -setup { catch {rename ::cookiejar ""} set f [makeFile "bogus content for a database" cookiejar] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar create ::cookiejar $f } -returnCodes error -cleanup { catch {rename ::cookiejar ""} @@ -197,7 +197,7 @@ test http-cookiejar-3.9 "cookie storage: class" -setup { test http-cookiejar-3.10 "cookie storage: class" -setup { catch {rename ::cookiejar ""} set dir [makeDirectory cookiejar] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar create ::cookiejar $dir } -returnCodes error -cleanup { catch {rename ::cookiejar ""} @@ -206,49 +206,49 @@ test http-cookiejar-3.10 "cookie storage: class" -setup { test http-cookiejar-4.1 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar } -returnCodes error -cleanup { ::cookiejar destroy } -result {wrong # args: should be "cookiejar method ?arg ...?"} test http-cookiejar-4.2 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar ? } -returnCodes error -cleanup { ::cookiejar destroy } -result {unknown method "?": must be destroy, forceLoadDomainData, getCookies, lookup, policyAllow or storeCookie} test http-cookiejar-4.3 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { lsort [info object methods cookiejar -all] } -cleanup { ::cookiejar destroy } -result {destroy forceLoadDomainData getCookies lookup policyAllow storeCookie} test http-cookiejar-4.4 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar getCookies } -returnCodes error -cleanup { ::cookiejar destroy } -result {wrong # args: should be "cookiejar getCookies proto host path"} test http-cookiejar-4.5 "cookie storage" -setup { http::cookiejar create ::cookiejar -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar getCookies http www.example.com / } -cleanup { ::cookiejar destroy } -result {} test http-cookiejar-4.6 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie } -returnCodes error -cleanup { ::cookiejar destroy } -result {wrong # args: should be "cookiejar storeCookie options"} test http-cookiejar-4.7 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar @@ -264,7 +264,7 @@ test http-cookiejar-4.7 "cookie storage: instance" -setup { test http-cookiejar-4.8 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar oo::objdefine ::cookiejar export Database -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar @@ -282,7 +282,7 @@ test http-cookiejar-4.8 "cookie storage: instance" -setup { test http-cookiejar-4.9 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar oo::objdefine ::cookiejar export Database -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar @@ -299,7 +299,7 @@ test http-cookiejar-4.9 "cookie storage: instance" -setup { } -result 0 test http-cookiejar-4.10 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie [dict replace { key foo value bar @@ -315,7 +315,7 @@ test http-cookiejar-4.10 "cookie storage: instance" -setup { test http-cookiejar-4.11 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar oo::objdefine ::cookiejar export Database -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie [dict replace { key foo value bar @@ -333,7 +333,7 @@ test http-cookiejar-4.11 "cookie storage: instance" -setup { test http-cookiejar-4.12 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar oo::objdefine ::cookiejar export Database -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie [dict replace { key foo value bar @@ -351,7 +351,7 @@ test http-cookiejar-4.12 "cookie storage: instance" -setup { test http-cookiejar-4.13 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { lappend result [cookiejar getCookies http www.example.com /] cookiejar storeCookie { key foo @@ -369,7 +369,7 @@ test http-cookiejar-4.13 "cookie storage: instance" -setup { test http-cookiejar-4.14 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { lappend result [cookiejar getCookies http www.example.com /] cookiejar storeCookie [dict replace { key foo @@ -387,7 +387,7 @@ test http-cookiejar-4.14 "cookie storage: instance" -setup { test http-cookiejar-4.15 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { lappend result [cookiejar getCookies http www.example.com /] cookiejar storeCookie { key foo @@ -414,7 +414,7 @@ test http-cookiejar-4.15 "cookie storage: instance" -setup { test http-cookiejar-4.16 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { lappend result [cookiejar getCookies http www.example.com /] cookiejar storeCookie { key foo1 @@ -440,7 +440,7 @@ test http-cookiejar-4.16 "cookie storage: instance" -setup { } -result {{} {foo1 bar foo2 bar}} test http-cookiejar-4.17 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar lookup a b c d } -returnCodes error -cleanup { ::cookiejar destroy @@ -448,7 +448,7 @@ test http-cookiejar-4.17 "cookie storage: instance" -setup { test http-cookiejar-4.18 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { lappend result [cookiejar lookup] lappend result [cookiejar lookup www.example.com] lappend result [catch {cookiejar lookup www.example.com foo} value] $value @@ -470,7 +470,7 @@ test http-cookiejar-4.18 "cookie storage: instance" -setup { test http-cookiejar-4.19 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar @@ -500,7 +500,7 @@ test http-cookiejar-4.19 "cookie storage: instance" -setup { test http-cookiejar-4.20 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie { key foo1 value bar1 @@ -529,7 +529,7 @@ test http-cookiejar-4.20 "cookie storage: instance" -setup { test http-cookiejar-4.21 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie { key foo1 value bar1 @@ -558,7 +558,7 @@ test http-cookiejar-4.21 "cookie storage: instance" -setup { test http-cookiejar-4.22 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar forceLoadDomainData x y z } -returnCodes error -cleanup { ::cookiejar destroy @@ -566,14 +566,14 @@ test http-cookiejar-4.22 "cookie storage: instance" -setup { test http-cookiejar-4.23 "cookie storage: instance" -setup { http::cookiejar create ::cookiejar set result {} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar forceLoadDomainData } -cleanup { ::cookiejar destroy } -result {} test http-cookiejar-4.23.a {cookie storage: instance} -setup { set off [http::cookiejar configure -offline] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar configure -offline 1 [http::cookiejar create ::cookiejar] destroy } -cleanup { @@ -582,7 +582,7 @@ test http-cookiejar-4.23.a {cookie storage: instance} -setup { } -result {} test http-cookiejar-4.23.b {cookie storage: instance} -setup { set off [http::cookiejar configure -offline] -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar configure -offline 0 [http::cookiejar create ::cookiejar] destroy } -cleanup { @@ -593,7 +593,7 @@ test http-cookiejar-4.23.b {cookie storage: instance} -setup { test http-cookiejar-5.1 "cookie storage: constraints" -setup { http::cookiejar create ::cookiejar cookiejar forceLoadDomainData -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar @@ -610,7 +610,7 @@ test http-cookiejar-5.1 "cookie storage: constraints" -setup { test http-cookiejar-5.2 "cookie storage: constraints" -setup { http::cookiejar create ::cookiejar cookiejar forceLoadDomainData -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar @@ -627,7 +627,7 @@ test http-cookiejar-5.2 "cookie storage: constraints" -setup { test http-cookiejar-5.3 "cookie storage: constraints" -setup { http::cookiejar create ::cookiejar cookiejar forceLoadDomainData -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie { key foo1 value bar @@ -653,7 +653,7 @@ test http-cookiejar-5.3 "cookie storage: constraints" -setup { test http-cookiejar-5.4 "cookie storage: constraints" -setup { http::cookiejar create ::cookiejar cookiejar forceLoadDomainData -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie { key foo value bar1 @@ -679,7 +679,7 @@ test http-cookiejar-5.4 "cookie storage: constraints" -setup { test http-cookiejar-5.5 "cookie storage: constraints" -setup { http::cookiejar create ::cookiejar cookiejar forceLoadDomainData -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { cookiejar storeCookie { key foo1 value 1 @@ -777,7 +777,7 @@ test http-cookiejar-6.1 "cookie storage: expiry and lookup" -setup { global result lappend result [lsort [lmap {k v} $cookies {set v}]] } -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { values [cookiejar getCookies http www.example.com /] cookiejar storeCookie { key foo @@ -833,7 +833,7 @@ test http-cookiejar-7.1 "cookie storage: persistence of persistent cookies" -set catch {rename ::cookiejar ""} set f [makeFile "" cookiejar] file delete $f -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar create ::cookiejar $f ::cookiejar destroy http::cookiejar create ::cookiejar $f @@ -846,7 +846,7 @@ test http-cookiejar-7.2 "cookie storage: persistence of persistent cookies" -set set f [makeFile "" cookiejar] file delete $f set result {} -} -constraints {notOSXtravis sqlite3 cookiejar} -body { +} -constraints {cookiejar} -body { http::cookiejar create ::cookiejar $f cookiejar storeCookie [dict replace { key foo -- cgit v0.12 From a42ecfa12e98e69b6171195353cba457c97536c7 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 2 Dec 2019 18:15:07 +0000 Subject: Bump to 8.7a4 to distinguish development from 8.7a3 release. --- README.md | 2 +- generic/tcl.h | 4 ++-- library/init.tcl | 2 +- unix/configure | 2 +- unix/configure.ac | 2 +- win/configure | 2 +- win/configure.ac | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6be63d4..242b3b1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # README: Tcl -This is the **Tcl 8.7a2** source distribution. +This is the **Tcl 8.7a4** source distribution. You can get any source release of Tcl from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). diff --git a/generic/tcl.h b/generic/tcl.h index 697a95f..01ebd9b 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -51,10 +51,10 @@ extern "C" { #define TCL_MAJOR_VERSION 8 #define TCL_MINOR_VERSION 7 #define TCL_RELEASE_LEVEL TCL_ALPHA_RELEASE -#define TCL_RELEASE_SERIAL 3 +#define TCL_RELEASE_SERIAL 4 #define TCL_VERSION "8.7" -#define TCL_PATCH_LEVEL "8.7a3" +#define TCL_PATCH_LEVEL "8.7a4" #if !defined(TCL_NO_DEPRECATED) || defined(RC_INVOKED) /* diff --git a/library/init.tcl b/library/init.tcl index 54d8a38..c6ef7a2 100644 --- a/library/init.tcl +++ b/library/init.tcl @@ -19,7 +19,7 @@ if {[info commands package] == ""} { error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]" } -package require -exact Tcl 8.7a3 +package require -exact Tcl 8.7a4 # Compute the auto path to use in this interpreter. # The values on the path come from several locations: diff --git a/unix/configure b/unix/configure index aa1c1b4..d653b98 100755 --- a/unix/configure +++ b/unix/configure @@ -2382,7 +2382,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TCL_VERSION=8.7 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=7 -TCL_PATCH_LEVEL="a3" +TCL_PATCH_LEVEL="a4" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/unix/configure.ac b/unix/configure.ac index 7145f53..c791df4 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [ TCL_VERSION=8.7 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=7 -TCL_PATCH_LEVEL="a3" +TCL_PATCH_LEVEL="a4" VERSION=${TCL_VERSION} EXTRA_INSTALL_BINARIES=${EXTRA_INSTALL_BINARIES:-"@:"} diff --git a/win/configure b/win/configure index 21bf306..1f5a1a2 100755 --- a/win/configure +++ b/win/configure @@ -2153,7 +2153,7 @@ SHELL=/bin/sh TCL_VERSION=8.7 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=7 -TCL_PATCH_LEVEL="a3" +TCL_PATCH_LEVEL="a4" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 diff --git a/win/configure.ac b/win/configure.ac index b46835c..37a9a28 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -14,7 +14,7 @@ SHELL=/bin/sh TCL_VERSION=8.7 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=7 -TCL_PATCH_LEVEL="a3" +TCL_PATCH_LEVEL="a4" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.4 -- cgit v0.12 From 4f6ea8aef90242e6052cf743e6684e312c84873c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 2 Dec 2019 20:26:58 +0000 Subject: If TCL_UTF_MAX>=4, make Tcl_ParseBackslash combine two surrogates so they appear as one 4-byte UTF-8 byte sequence from the start. Add test-case for this. --- generic/tclParse.c | 10 ++++++ generic/tclUtf.c | 2 +- generic/tclUtil.c | 2 +- tests/utf.test | 103 +++++++++++++++++++++++++++-------------------------- 4 files changed, 65 insertions(+), 52 deletions(-) diff --git a/generic/tclParse.c b/generic/tclParse.c index 1532c05..4f30f8b 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -920,6 +920,16 @@ TclParseBackslash( * No hexadigits -> This is just "u". */ result = 'u'; +#if TCL_UTF_MAX > 3 + } else if (((result & 0xDC00) == 0xD800) && (count == 6) && (p[5] == '\\') && (p[6] == 'u') && (numBytes >= 10)) { + /* If high surrogate is immediately followed by a low surrogate escape, combine them. */ + int low; + int count2 = TclParseHex(p+7, 4, &low); + if ((low & 0xDC00) == 0xDC00) { + result = ((result & 0x3FF)<<10 | (low & 0x3FF)) + 0x10000; + count += count2 + 2; + } +#endif } break; case 'U': diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 9c2ef03..ce80bd0 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -846,7 +846,7 @@ Tcl_UtfBackslash( * We ate a whole line. Pay the price of a strlen() */ - result = TclParseBackslash(src, (int)strlen(src), &numRead, dst); + result = TclParseBackslash(src, strlen(src), &numRead, dst); } if (readPtr != NULL) { *readPtr = numRead; diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 61c1973..41b3481 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -1649,7 +1649,7 @@ Tcl_Backslash( int *readPtr) /* Fill in with number of characters read from * src, unless NULL. */ { - char buf[TCL_UTF_MAX] = ""; + char buf[4] = ""; Tcl_UniChar ch = 0; Tcl_UtfBackslash(src, readPtr, buf); diff --git a/tests/utf.test b/tests/utf.test index c43d95a..1e257d3 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -21,40 +21,43 @@ testConstraint testbytestring [llength [info commands testbytestring]] catch {unset x} # Some tests require support for 4-byte UTF-8 sequences -testConstraint fullutf [expr {[format %c 0x010000] != "\ufffd"}] +testConstraint fullutf [expr {[format %c 0x010000] != "\uFFFD"}] test utf-1.1 {Tcl_UniCharToUtf: 1 byte sequences} testbytestring { expr {"\x01" eq [testbytestring "\x01"]} } 1 test utf-1.2 {Tcl_UniCharToUtf: 2 byte sequences} testbytestring { - expr {"\x00" eq [testbytestring "\xc0\x80"]} + expr {"\x00" eq [testbytestring "\xC0\x80"]} } 1 test utf-1.3 {Tcl_UniCharToUtf: 2 byte sequences} testbytestring { - expr {"\xe0" eq [testbytestring "\xc3\xa0"]} + expr {"\xE0" eq [testbytestring "\xC3\xA0"]} } 1 test utf-1.4 {Tcl_UniCharToUtf: 3 byte sequences} testbytestring { - expr {"\u4e4e" eq [testbytestring "\xe4\xb9\x8e"]} + expr {"\u4E4E" eq [testbytestring "\xE4\xB9\x8E"]} } 1 test utf-1.5 {Tcl_UniCharToUtf: overflowed Tcl_UniChar} testbytestring { - expr {[format %c 0x110000] eq [testbytestring "\xef\xbf\xbd"]} + expr {[format %c 0x110000] eq [testbytestring "\xEF\xBF\xBD"]} } 1 test utf-1.6 {Tcl_UniCharToUtf: negative Tcl_UniChar} testbytestring { - expr {[format %c -1] eq [testbytestring "\xef\xbf\xbd"]} + expr {[format %c -1] eq [testbytestring "\xEF\xBF\xBD"]} } 1 test utf-1.7 {Tcl_UniCharToUtf: 4 byte sequences} -constraints {fullutf testbytestring} -body { - expr {"\U014e4e" eq [testbytestring "\xf0\x94\xb9\x8e"]} + expr {"\U014E4E" eq [testbytestring "\xF0\x94\xB9\x8E"]} } -result 1 test utf-1.8 {Tcl_UniCharToUtf: 3 byte sequence, high surrogate} testbytestring { - expr {"\ud842" eq [testbytestring "\xed\xa1\x82"]} + expr {"\uD842" eq [testbytestring "\xED\xA1\x82"]} } 1 test utf-1.9 {Tcl_UniCharToUtf: 3 byte sequence, low surrogate} testbytestring { - expr {"\udc42" eq [testbytestring "\xed\xb1\x82"]} + expr {"\uDC42" eq [testbytestring "\xED\xB1\x82"]} } 1 test utf-1.10 {Tcl_UniCharToUtf: 3 byte sequence, high surrogate} testbytestring { - expr {[format %c 0xd842] eq [testbytestring "\xed\xa1\x82"]} + expr {[format %c 0xD842] eq [testbytestring "\xED\xA1\x82"]} } 1 test utf-1.11 {Tcl_UniCharToUtf: 3 byte sequence, low surrogate} testbytestring { - expr {[format %c 0xdc42] eq [testbytestring "\xed\xb1\x82"]} + expr {[format %c 0xDC42] eq [testbytestring "\xED\xB1\x82"]} +} 1 +test utf-1.12 {Tcl_UniCharToUtf: 4 byte sequence, high/low surrogate} {fullutf testbytestring} { + expr {"\uD842\uDC42" eq [testbytestring "\xF0\xA0\xA1\x82"]} } 1 test utf-2.1 {Tcl_UtfToUniChar: low ascii} { @@ -67,7 +70,7 @@ test utf-2.3 {Tcl_UtfToUniChar: lead (2-byte) followed by non-trail} testbytestr string length [testbytestring "\xC2"] } {1} test utf-2.4 {Tcl_UtfToUniChar: lead (2-byte) followed by trail} testbytestring { - string length [testbytestring "\xC2\xa2"] + string length [testbytestring "\xC2\xA2"] } {1} test utf-2.5 {Tcl_UtfToUniChar: lead (3-byte) followed by non-trail} testbytestring { string length [testbytestring "\xE2"] @@ -76,7 +79,7 @@ test utf-2.6 {Tcl_UtfToUniChar: lead (3-byte) followed by 1 trail} testbytestrin string length [testbytestring "\xE2\xA2"] } {2} test utf-2.7 {Tcl_UtfToUniChar: lead (3-byte) followed by 2 trail} testbytestring { - string length [testbytestring "\xE4\xb9\x8e"] + string length [testbytestring "\xE4\xB9\x8E"] } {1} test utf-2.8 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} -constraints {fullutf testbytestring} -body { string length [testbytestring "\xF0\x90\x80\x80"] @@ -150,21 +153,21 @@ test utf-8.1 {Tcl_UniCharAtIndex: index = 0} { string index abcd 0 } {a} test utf-8.2 {Tcl_UniCharAtIndex: index = 0} { - string index \u4e4e\u25a 0 -} "\u4e4e" + string index \u4E4E\u25A 0 +} "\u4E4E" test utf-8.3 {Tcl_UniCharAtIndex: index > 0} { string index abcd 2 } {c} test utf-8.4 {Tcl_UniCharAtIndex: index > 0} { - string index \u4e4e\u25a\xff\u543 2 + string index \u4E4E\u25A\xFF\u543 2 } "\uff" test utf-9.1 {Tcl_UtfAtIndex: index = 0} { string range abcd 0 2 } {abc} test utf-9.2 {Tcl_UtfAtIndex: index > 0} { - string range \u4e4e\u25a\xff\u543klmnop 1 5 -} "\u25a\xff\u543kl" + string range \u4E4E\u25A\xFF\u543klmnop 1 5 +} "\u25A\xFF\u543kl" test utf-10.1 {Tcl_UtfBackslash: dst == NULL} { @@ -172,16 +175,16 @@ test utf-10.1 {Tcl_UtfBackslash: dst == NULL} { } { } test utf-10.2 {Tcl_UtfBackslash: \u subst} testbytestring { - expr {"\ua2" eq [testbytestring "\xc2\xa2"]} + expr {"\uA2" eq [testbytestring "\xC2\xA2"]} } 1 test utf-10.3 {Tcl_UtfBackslash: longer \u subst} testbytestring { - expr {"\u4e21" eq [testbytestring "\xe4\xb8\xa1"]} + expr {"\u4E21" eq [testbytestring "\xE4\xB8\xA1"]} } 1 test utf-10.4 {Tcl_UtfBackslash: stops at first non-hex} testbytestring { - expr {"\u4e2k" eq "[testbytestring \xd3\xa2]k"} + expr {"\u4E2k" eq "[testbytestring \xD3\xA2]k"} } 1 test utf-10.5 {Tcl_UtfBackslash: stops after 4 hex chars} testbytestring { - expr {"\u4e216" eq "[testbytestring \xe4\xb8\xa1]6"} + expr {"\u4E216" eq "[testbytestring \xE4\xB8\xA1]6"} } 1 proc bsCheck {char num} { global errNum @@ -227,8 +230,8 @@ bsCheck \u41 65 bsCheck \ua 10 bsCheck \uA 10 bsCheck \340 224 -bsCheck \ua1 161 -bsCheck \u4e21 20001 +bsCheck \uA1 161 +bsCheck \u4E21 20001 bsCheck \741 60 bsCheck \U 85 bsCheck \Uk 85 @@ -236,10 +239,10 @@ bsCheck \U41 65 bsCheck \Ua 10 bsCheck \UA 10 bsCheck \Ua1 161 -bsCheck \U4e21 20001 -bsCheck \U004e21 20001 -bsCheck \U00004e21 20001 -bsCheck \U0000004e21 78 +bsCheck \U4E21 20001 +bsCheck \U004E21 20001 +bsCheck \U00004E21 20001 +bsCheck \U0000004E21 78 if {[testConstraint fullutf]} { bsCheck \U00110000 69632 bsCheck \U01100000 69632 @@ -257,14 +260,14 @@ test utf-11.2 {Tcl_UtfToUpper} { string toupper abc } ABC test utf-11.3 {Tcl_UtfToUpper} { - string toupper \u00e3ab -} \u00c3AB + string toupper \u00E3ab +} \u00C3AB test utf-11.4 {Tcl_UtfToUpper} { - string toupper \u01e3ab -} \u01e2AB + string toupper \u01E3ab +} \u01E2AB test utf-11.5 {Tcl_UtfToUpper Georgian (new in Unicode 11)} { - string toupper \u10d0\u1c90 -} \u1c90\u1c90 + string toupper \u10D0\u1C90 +} \u1C90\u1C90 test utf-12.1 {Tcl_UtfToLower} { string tolower {} @@ -273,14 +276,14 @@ test utf-12.2 {Tcl_UtfToLower} { string tolower ABC } abc test utf-12.3 {Tcl_UtfToLower} { - string tolower \u00c3AB -} \u00e3ab + string tolower \u00C3AB +} \u00E3ab test utf-12.4 {Tcl_UtfToLower} { - string tolower \u01e2AB -} \u01e3ab + string tolower \u01E2AB +} \u01E3ab test utf-12.5 {Tcl_UtfToLower Georgian (new in Unicode 11)} { - string tolower \u10d0\u1c90 -} \u10d0\u10d0 + string tolower \u10D0\u1C90 +} \u10D0\u10D0 test utf-13.1 {Tcl_UtfToTitle} { string totitle {} @@ -289,17 +292,17 @@ test utf-13.2 {Tcl_UtfToTitle} { string totitle abc } Abc test utf-13.3 {Tcl_UtfToTitle} { - string totitle \u00e3ab -} \u00c3ab + string totitle \u00E3ab +} \u00C3ab test utf-13.4 {Tcl_UtfToTitle} { - string totitle \u01f3ab -} \u01f2ab + string totitle \u01F3ab +} \u01F2ab test utf-13.5 {Tcl_UtfToTitle Georgian (new in Unicode 11)} { - string totitle \u10d0\u1c90 -} \u10d0\u1c90 + string totitle \u10D0\u1C90 +} \u10D0\u1C90 test utf-13.6 {Tcl_UtfToTitle Georgian (new in Unicode 11)} { - string totitle \u1c90\u10d0 -} \u1c90\u10d0 + string totitle \u1C90\u10D0 +} \u1C90\u10D0 test utf-14.1 {Tcl_UtfNcasecmp} { string compare -nocase a b @@ -328,8 +331,8 @@ test utf-16.1 {Tcl_UniCharToLower, negative delta} { string tolower aA } aa test utf-16.2 {Tcl_UniCharToLower, positive delta} { - string tolower \u0178\u00ff\uA78D\u01c5\U10400 -} \u00ff\u00ff\u0265\u01c6\U10428 + string tolower \u0178\u00ff\uA78D\u01c5 +} \u00ff\u00ff\u0265\u01c6 test utf-17.1 {Tcl_UniCharToLower, no delta} { string tolower ! -- cgit v0.12 From 36f4518f890ff81b22fbf1575775ffaf1c1a149b Mon Sep 17 00:00:00 2001 From: pooryorick Date: Mon, 2 Dec 2019 22:04:41 +0000 Subject: Add tcltest::CleanupTest to make it easier to customize behaviour. --- library/tcltest/tcltest.tcl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 4171965..28c50ef 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -2069,7 +2069,9 @@ proc tcltest::test {name description args} { } # Always run the cleanup script - set code [catch {uplevel 1 $cleanup} cleanupMsg] + set code [catch { + uplevel 1 [list [namespace which CleanupTest] $cleanup] + } cleanupMsg] if {$code == 1} { set errorInfo(cleanup) $::errorInfo set errorCodeRes(cleanup) $::errorCode @@ -2382,6 +2384,14 @@ proc tcltest::SetupTest setup { uplevel 1 $setup } + +# CleanupTest -- +# +# Evaluates the -cleanup script for a test +proc tcltest::CleanupTest cleanup { + uplevel 1 $cleanup +} + ##################################################################### # tcltest::cleanupTestsHook -- -- cgit v0.12 From 9e0083e9f07d37493c802ab11661736fa680e12c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 3 Dec 2019 12:27:42 +0000 Subject: Fix [3cd9bea1e6]: check-in [43032d7ba3] potential problems. Also don't allow surrogates in \U?????? syntax. --- generic/tclParse.c | 21 ++++++++----- tests/string.test | 89 +++++++++++++++++++++++++----------------------------- tests/utf.test | 72 ++++++++++++++++++++++++------------------- 3 files changed, 95 insertions(+), 87 deletions(-) diff --git a/generic/tclParse.c b/generic/tclParse.c index 4f30f8b..b42ff5c 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -870,7 +870,7 @@ TclParseBackslash( count = 2; switch (*p) { /* - * Note: in the conversions below, use absolute values (e.g., 0xa) + * Note: in the conversions below, use absolute values (e.g., 0xA) * rather than symbolic values (e.g. \n) that get converted by the * compiler. It's possible that compilers on some platforms will do * the symbolic conversions differently, which could result in @@ -884,19 +884,19 @@ TclParseBackslash( result = 0x8; break; case 'f': - result = 0xc; + result = 0xC; break; case 'n': - result = 0xa; + result = 0xA; break; case 'r': - result = 0xd; + result = 0xD; break; case 't': result = 0x9; break; case 'v': - result = 0xb; + result = 0xB; break; case 'x': count += TclParseHex(p+1, (numBytes > 3) ? 2 : numBytes-2, &result); @@ -921,11 +921,13 @@ TclParseBackslash( */ result = 'u'; #if TCL_UTF_MAX > 3 - } else if (((result & 0xDC00) == 0xD800) && (count == 6) && (p[5] == '\\') && (p[6] == 'u') && (numBytes >= 10)) { - /* If high surrogate is immediately followed by a low surrogate escape, combine them. */ + } else if (((result & 0xDC00) == 0xD800) && (count == 6) + && (p[5] == '\\') && (p[6] == 'u') && (numBytes >= 10)) { + /* If high surrogate is immediately followed by a low surrogate + * escape, combine them into one character. */ int low; int count2 = TclParseHex(p+7, 4, &low); - if ((low & 0xDC00) == 0xDC00) { + if ((count2 == 4) && ((low & 0xDC00) == 0xDC00)) { result = ((result & 0x3FF)<<10 | (low & 0x3FF)) + 0x10000; count += count2 + 2; } @@ -939,6 +941,9 @@ TclParseBackslash( * No hexadigits -> This is just "U". */ result = 'U'; + } else if ((result | 0x7FF) == 0xDFFF) { + /* Upper or lower surrogate, not allowed in this syntax. */ + result = 0xFFFD; } break; case '\n': diff --git a/tests/string.test b/tests/string.test index a3590e5..f5defd9 100644 --- a/tests/string.test +++ b/tests/string.test @@ -222,7 +222,7 @@ test string-4.15 {string first, ability to two-byte encoded utf-8 chars} { # Test for a bug in Tcl 8.3 where test for all-single-byte-encoded # strings was incorrect, leading to an index returned by [string first] # which pointed past the end of the string. - set uchar \u057e ;# character with two-byte encoding in utf-8 + set uchar \u057E ;# character with two-byte encoding in utf-8 string first % %#$uchar$uchar#$uchar$uchar#% 3 } 8 test string-4.17 {string first, corner case} { @@ -309,9 +309,6 @@ test string-5.19 {string index, bytearray object out of bounds} { test string-5.20 {string index, bytearray object out of bounds} { string index [binary format I* {0x50515253 0x52}] 20 } {} -test string-5.21 {string index, surrogates, bug [11ae2be95dac9417]} tip389 { - list [string index a\U100000b 1] [string index a\U100000b 2] [string index a\U100000b 3] -} [list \U100000 {} b] proc largest_int {} { @@ -395,7 +392,7 @@ test string-6.24 {string is digit, true} { string is digit 0123456789 } 1 test string-6.25 {string is digit, false} { - list [string is digit -fail var 0123\u00dc567] $var + list [string is digit -fail var 0123\u00DC567] $var } {0 4} test string-6.26 {string is digit, false} { list [string is digit -fail var +123567] $var @@ -518,7 +515,7 @@ test string-6.60 {string is lower, true} { string is lower abc } 1 test string-6.61 {string is lower, unicode true} { - string is lower abc\u00fcue + string is lower abc\u00FCue } 1 test string-6.62 {string is lower, false} { list [string is lower -fail var aBc] $var @@ -527,7 +524,7 @@ test string-6.63 {string is lower, false} { list [string is lower -fail var abc1] $var } {0 3} test string-6.64 {string is lower, unicode false} { - list [string is lower -fail var ab\u00dcUE] $var + list [string is lower -fail var ab\u00DCUE] $var } {0 2} test string-6.65 {string is space, true} { string is space " \t\n\v\f" @@ -565,7 +562,7 @@ test string-6.75 {string is upper, true} { string is upper ABC } 1 test string-6.76 {string is upper, unicode true} { - string is upper ABC\u00dcUE + string is upper ABC\u00DCUE } 1 test string-6.77 {string is upper, false} { list [string is upper -fail var AbC] $var @@ -574,13 +571,13 @@ test string-6.78 {string is upper, false} { list [string is upper -fail var AB2C] $var } {0 2} test string-6.79 {string is upper, unicode false} { - list [string is upper -fail var ABC\u00fcue] $var + list [string is upper -fail var ABC\u00FCue] $var } {0 3} test string-6.80 {string is wordchar, true} { string is wordchar abc_123 } 1 test string-6.81 {string is wordchar, unicode true} { - string is wordchar abc\u00fcab\u00dcAB\u5001 + string is wordchar abc\u00FCab\u00DCAB\u5001 } 1 test string-6.82 {string is wordchar, false} { list [string is wordchar -fail var abcd.ef] $var @@ -606,7 +603,7 @@ test string-6.87 {string is print} { } {0 15} test string-6.88 {string is punct} { ## any graph char that isn't alnum - list [string is punct -fail var "_!@#\u00beq0"] $var + list [string is punct -fail var "_!@#\u00BEq0"] $var } {0 4} test string-6.89 {string is xdigit} { list [string is xdigit -fail var 0123456789\u0061bcdefABCDEFg] $var @@ -699,7 +696,7 @@ test string-6.108 {string is double, Bug 1382287} { string is double $x } 0 test string-6.109 {string is double, Bug 1360532} { - string is double 1\u00a0 + string is double 1\u00A0 } 0 test string-6.110 {string is entier, true} { string is entier +1234567890 @@ -1278,8 +1275,8 @@ test string-12.19 {string range, bytearray object} { string equal $r1 $r2 } 1 test string-12.20 {string range, out of bounds indices} { - string range \u00ff 0 1 -} \u00ff + string range \u00FF 0 1 +} \u00FF # Bug 1410553 test string-12.21 {string range, regenerates correct reps, bug 1410553} { set bytes "\x00 \x03 \x41" @@ -1490,18 +1487,14 @@ test string-17.5 {string totitle} { string totitle {123#$&*()} } {123#$&*()} test string-17.6 {string totitle, unicode} { - string totitle ABCabc\xc7\xe7 -} "Abcabc\xe7\xe7" + string totitle ABCabc\xC7\xE7 +} "Abcabc\xE7\xE7" test string-17.7 {string totitle, unicode} { - string totitle \u01f3BCabc\xc7\xe7 -} "\u01f2bcabc\xe7\xe7" + string totitle \u01F3BCabc\xc7\xe7 +} "\u01F2bcabc\xe7\xe7" test string-17.8 {string totitle, compiled} { lindex [string totitle [list aa bb [list cc]]] 0 } Aa -test string-17.9 {string totitle, surrogates, bug [11ae2be95dac9417]} tip389 { - list [string totitle a\U118c0c 1 1] [string totitle a\U118c0c 2 2] \ - [string totitle a\U118c0c 3 3] -} [list a\U118a0c a\U118c0C a\U118c0C] test string-18.1 {string trim} { list [catch {string trim} msg] $msg @@ -1537,7 +1530,7 @@ test string-18.11 {string trim, unicode} { string trim "\xe7\xe8 AB\xe7C \xe8\xe7" \xe7\xe8 } " AB\xe7C " test string-18.12 {string trim, unicode default} { - string trim \ufeff\x00\u0085\u00a0\u1680\u180eABC\u1361\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000 + string trim \uFEFF\x00\u0085\u00A0\u1680\u180EABC\u1361\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2028\u2029\u202F\u205F\u3000 } ABC\u1361 test string-19.1 {string trimleft} { @@ -1547,7 +1540,7 @@ test string-19.2 {string trimleft} { string trimleft " XYZ " } {XYZ } test string-19.3 {string trimleft, unicode default} { - string trimleft \ufeff\u0085\u00a0\x00\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000\u1361ABC + string trimleft \uFEFF\u0085\u00A0\x00\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2028\u2029\u202F\u205F\u3000\u1361ABC } \u1361ABC test string-20.1 {string trimright errors} { @@ -1566,7 +1559,7 @@ test string-20.5 {string trimright} { string trimright "" } {} test string-20.6 {string trimright, unicode default} { - string trimright ABC\u1361\u0085\x00\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u202f\u205f\u3000 + string trimright ABC\u1361\u0085\x00\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2028\u2029\u202F\u205F\u3000 } ABC\u1361 test string-21.1 {string wordend} { @@ -1597,19 +1590,19 @@ test string-21.9 {string wordend} { string worde "x.y" end-1 } 2 test string-21.10 {string wordend, unicode} { - string wordend "xyz\u00c7de fg" 0 + string wordend "xyz\u00C7de fg" 0 } 6 test string-21.11 {string wordend, unicode} { - string wordend "xyz\uc700de fg" 0 + string wordend "xyz\uC700de fg" 0 } 6 test string-21.12 {string wordend, unicode} { - string wordend "xyz\u203fde fg" 0 + string wordend "xyz\u203Fde fg" 0 } 6 test string-21.13 {string wordend, unicode} { string wordend "xyz\u2045de fg" 0 } 3 test string-21.14 {string wordend, unicode} { - string wordend "\uc700\uc700 abc" 8 + string wordend "\uC700\uC700 abc" 8 } 6 test string-22.1 {string wordstart} { @@ -1643,13 +1636,13 @@ test string-22.10 {string wordstart} { string wordstart "one two three" end-5 } 7 test string-22.11 {string wordstart, unicode} { - string wordstart "one tw\u00c7o three" 7 + string wordstart "one tw\u00C7o three" 7 } 4 test string-22.12 {string wordstart, unicode} { - string wordstart "ab\uc700\uc700 cdef ghi" 12 + string wordstart "ab\uC700\uC700 cdef ghi" 12 } 10 test string-22.13 {string wordstart, unicode} { - string wordstart "\uc700\uc700 abc" 8 + string wordstart "\uC700\uC700 abc" 8 } 3 test string-23.0 {string is boolean, Bug 1187123} testindexobj { @@ -1720,40 +1713,40 @@ test string-24.4 {string reverse command - unshared string} { string reverse $x$y } edcba test string-24.5 {string reverse command - shared unicode string} { - set x abcde\ud0ad + set x abcde\uD0AD string reverse $x -} \ud0adedcba +} \uD0ADedcba test string-24.6 {string reverse command - unshared string} { set x abc - set y de\ud0ad + set y de\uD0AD string reverse $x$y -} \ud0adedcba +} \uD0ADedcba test string-24.7 {string reverse command - simple case} { string reverse a } a test string-24.8 {string reverse command - simple case} { - string reverse \ud0ad -} \ud0ad + string reverse \uD0AD +} \uD0AD test string-24.9 {string reverse command - simple case} { string reverse {} } {} test string-24.10 {string reverse command - corner case} { - set x \ubeef\ud0ad + set x \uBEEF\uD0AD string reverse $x -} \ud0ad\ubeef +} \uD0AD\uBEEF test string-24.11 {string reverse command - corner case} { - set x \ubeef - set y \ud0ad + set x \uBEEF + set y \uD0AD string reverse $x$y -} \ud0ad\ubeef +} \uD0AD\uBEEF test string-24.12 {string reverse command - corner case} { - set x \ubeef - set y \ud0ad + set x \uBEEF + set y \uD0AD string is ascii [string reverse $x$y] } 0 test string-24.13 {string reverse command - pure Unicode string} { - string reverse [string range \ubeef\ud0ad\ubeef\ud0ad\ubeef\ud0ad 1 5] -} \ud0ad\ubeef\ud0ad\ubeef\ud0ad + string reverse [string range \uBEEF\uD0AD\uBEEF\uD0AD\uBEEF\uD0AD 1 5] +} \uD0AD\uBEEF\uD0AD\uBEEF\uD0AD test string-24.14 {string reverse command - pure bytearray} { binary scan [string reverse [binary format H* 010203]] H* x set x @@ -1809,7 +1802,7 @@ test string-25.13 {string is list} { } {0 2} test string-25.14 {string is list} { set x {} - list [string is list -failindex x "\uabcd {b c}d e"] $x + list [string is list -failindex x "\uABCD {b c}d e"] $x } {0 2} test string-26.1 {tcl::prefix, too few args} -body { diff --git a/tests/utf.test b/tests/utf.test index 1e257d3..2e4882d 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -22,6 +22,7 @@ catch {unset x} # Some tests require support for 4-byte UTF-8 sequences testConstraint fullutf [expr {[format %c 0x010000] != "\uFFFD"}] +testConstraint tip389 [expr {[string length \U010000] == 2}] test utf-1.1 {Tcl_UniCharToUtf: 1 byte sequences} testbytestring { expr {"\x01" eq [testbytestring "\x01"]} @@ -59,6 +60,9 @@ test utf-1.11 {Tcl_UniCharToUtf: 3 byte sequence, low surrogate} testbytestring test utf-1.12 {Tcl_UniCharToUtf: 4 byte sequence, high/low surrogate} {fullutf testbytestring} { expr {"\uD842\uDC42" eq [testbytestring "\xF0\xA0\xA1\x82"]} } 1 +test utf-1.13 {Tcl_UniCharToUtf: Invalid surrogate} testbytestring { + expr {"\UD842" eq [testbytestring "\xEF\xBF\xBD"]} +} 1 test utf-2.1 {Tcl_UtfToUniChar: low ascii} { string length "abc" @@ -81,10 +85,10 @@ test utf-2.6 {Tcl_UtfToUniChar: lead (3-byte) followed by 1 trail} testbytestrin test utf-2.7 {Tcl_UtfToUniChar: lead (3-byte) followed by 2 trail} testbytestring { string length [testbytestring "\xE4\xB9\x8E"] } {1} -test utf-2.8 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} -constraints {fullutf testbytestring} -body { +test utf-2.8 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} -constraints {tip389 testbytestring} -body { string length [testbytestring "\xF0\x90\x80\x80"] } -result {2} -test utf-2.9 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} -constraints {fullutf testbytestring} -body { +test utf-2.9 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail} -constraints {tip389 testbytestring} -body { string length [testbytestring "\xF4\x8F\xBF\xBF"] } -result {2} test utf-2.10 {Tcl_UtfToUniChar: lead (4-byte) followed by 3 trail, underflow} testbytestring { @@ -160,7 +164,7 @@ test utf-8.3 {Tcl_UniCharAtIndex: index > 0} { } {c} test utf-8.4 {Tcl_UniCharAtIndex: index > 0} { string index \u4E4E\u25A\xFF\u543 2 -} "\uff" +} "\uFF" test utf-9.1 {Tcl_UtfAtIndex: index = 0} { string range abcd 0 2 @@ -186,6 +190,12 @@ test utf-10.4 {Tcl_UtfBackslash: stops at first non-hex} testbytestring { test utf-10.5 {Tcl_UtfBackslash: stops after 4 hex chars} testbytestring { expr {"\u4E216" eq "[testbytestring \xE4\xB8\xA1]6"} } 1 +test utf-10.6 {Tcl_UtfBackslash: stops after 5 hex chars} {fullutf testbytestring} { + expr {"\U1E2165" eq "[testbytestring \xF0\x9E\x88\x96]5"} +} 1 +test utf-10.7 {Tcl_UtfBackslash: stops after 6 hex chars} {fullutf testbytestring} { + expr {"\U10E2165" eq "[testbytestring \xF4\x8E\x88\x96]5"} +} 1 proc bsCheck {char num} { global errNum test utf-10.$errNum {backslash substitution} { @@ -194,7 +204,7 @@ proc bsCheck {char num} { } $num incr errNum } -set errNum 6 +set errNum 8 bsCheck \b 8 bsCheck \e 101 bsCheck \f 12 @@ -260,10 +270,10 @@ test utf-11.2 {Tcl_UtfToUpper} { string toupper abc } ABC test utf-11.3 {Tcl_UtfToUpper} { - string toupper \u00E3ab + string toupper \u00E3AB } \u00C3AB test utf-11.4 {Tcl_UtfToUpper} { - string toupper \u01E3ab + string toupper \u01E3AB } \u01E2AB test utf-11.5 {Tcl_UtfToUpper Georgian (new in Unicode 11)} { string toupper \u10D0\u1C90 @@ -292,10 +302,10 @@ test utf-13.2 {Tcl_UtfToTitle} { string totitle abc } Abc test utf-13.3 {Tcl_UtfToTitle} { - string totitle \u00E3ab + string totitle \u00E3AB } \u00C3ab test utf-13.4 {Tcl_UtfToTitle} { - string totitle \u01F3ab + string totitle \u01F3AB } \u01F2ab test utf-13.5 {Tcl_UtfToTitle Georgian (new in Unicode 11)} { string totitle \u10D0\u1C90 @@ -321,7 +331,7 @@ test utf-15.1 {Tcl_UniCharToUpper, negative delta} { string toupper aA } AA test utf-15.2 {Tcl_UniCharToUpper, positive delta} { - string toupper \u0178\u00ff + string toupper \u0178\u00FF } \u0178\u0178 test utf-15.3 {Tcl_UniCharToUpper, no delta} { string toupper ! @@ -331,24 +341,24 @@ test utf-16.1 {Tcl_UniCharToLower, negative delta} { string tolower aA } aa test utf-16.2 {Tcl_UniCharToLower, positive delta} { - string tolower \u0178\u00ff\uA78D\u01c5 -} \u00ff\u00ff\u0265\u01c6 + string tolower \u0178\u00FF\uA78D\u01C5 +} \u00FF\u00FF\u0265\u01C6 test utf-17.1 {Tcl_UniCharToLower, no delta} { string tolower ! } ! test utf-18.1 {Tcl_UniCharToTitle, add one for title} { - string totitle \u01c4 -} \u01c5 + string totitle \u01C4 +} \u01C5 test utf-18.2 {Tcl_UniCharToTitle, subtract one for title} { - string totitle \u01c6 -} \u01c5 + string totitle \u01C6 +} \u01C5 test utf-18.3 {Tcl_UniCharToTitle, subtract delta for title (positive)} { - string totitle \u017f + string totitle \u017F } \u0053 test utf-18.4 {Tcl_UniCharToTitle, subtract delta for title (negative)} { - string totitle \u00ff + string totitle \u00FF } \u0178 test utf-18.5 {Tcl_UniCharToTitle, no delta} { string totitle ! @@ -365,15 +375,15 @@ test utf-20.1 {TclUniCharNcmp} { test utf-21.1 {TclUniCharIsAlnum} { # this returns 1 with Unicode 7 compliance - string is alnum \u1040\u021f\u0220 + string is alnum \u1040\u021F\u0220 } {1} test utf-21.2 {unicode alnum char in regc_locale.c} { # this returns 1 with Unicode 7 compliance - list [regexp {^[[:alnum:]]+$} \u1040\u021f\u0220] [regexp {^\w+$} \u1040\u021f\u0220_\u203f\u2040\u2054\ufe33\ufe34\ufe4d\ufe4e\ufe4f\uff3f] + list [regexp {^[[:alnum:]]+$} \u1040\u021F\u0220] [regexp {^\w+$} \u1040\u021F\u0220_\u203F\u2040\u2054\uFE33\uFE34\uFE4D\uFE4E\uFE4F\uFF3F] } {1 1} test utf-21.3 {unicode print char in regc_locale.c} { # this returns 1 with Unicode 7 compliance - regexp {^[[:print:]]+$} \ufbc1 + regexp {^[[:print:]]+$} \uFBC1 } 1 test utf-21.4 {TclUniCharIsGraph} { # [Bug 3464428] @@ -385,11 +395,11 @@ test utf-21.5 {unicode graph char in regc_locale.c} { } {1} test utf-21.6 {TclUniCharIsGraph} { # [Bug 3464428] - string is graph \u00a0 + string is graph \u00A0 } {0} test utf-21.7 {unicode graph char in regc_locale.c} { # [Bug 3464428] - regexp {[[:graph:]]} \u0020\u00a0\u2028\u2029 + regexp {[[:graph:]]} \u0020\u00A0\u2028\u2029 } {0} test utf-21.8 {TclUniCharIsPrint} { # [Bug 3464428] @@ -405,45 +415,45 @@ test utf-21.10 {unicode print char in regc_locale.c} { } {0} test utf-21.11 {TclUniCharIsControl} { # [Bug 3464428] - string is control \u0000\u001f\u00ad\u0605\u061c\u180e\u2066\ufeff + string is control \u0000\u001F\u00AD\u0605\u061C\u180E\u2066\uFEFF } {1} test utf-21.12 {unicode control char in regc_locale.c} { # [Bug 3464428], [Bug a876646efe] - regexp {^[[:cntrl:]]*$} \u0000\u001f\u00ad\u0605\u061c\u180e\u2066\ufeff + regexp {^[[:cntrl:]]*$} \u0000\u001F\u00AD\u0605\u061C\u180E\u2066\uFEFF } {1} test utf-22.1 {TclUniCharIsWordChar} { string wordend "xyz123_bar fg" 0 } 10 test utf-22.2 {TclUniCharIsWordChar} { - string wordend "x\u5080z123_bar\u203c fg" 0 + string wordend "x\u5080z123_bar\u203C fg" 0 } 10 test utf-23.1 {TclUniCharIsAlpha} { # this returns 1 with Unicode 7 compliance - string is alpha \u021f\u0220\u037f\u052f + string is alpha \u021F\u0220\u037F\u052F } {1} test utf-23.2 {unicode alpha char in regc_locale.c} { # this returns 1 with Unicode 7 compliance - regexp {^[[:alpha:]]+$} \u021f\u0220\u037f\u052f + regexp {^[[:alpha:]]+$} \u021F\u0220\u037F\u052F } {1} test utf-24.1 {TclUniCharIsDigit} { # this returns 1 with Unicode 7 compliance - string is digit \u1040\uabf0 + string is digit \u1040\uABF0 } {1} test utf-24.2 {unicode digit char in regc_locale.c} { # this returns 1 with Unicode 7 compliance - list [regexp {^[[:digit:]]+$} \u1040\uabf0] [regexp {^\d+$} \u1040\uabf0] + list [regexp {^[[:digit:]]+$} \u1040\uABF0] [regexp {^\d+$} \u1040\uABF0] } {1 1} test utf-24.3 {TclUniCharIsSpace} { # this returns 1 with Unicode 7/TIP 413 compliance - string is space \u0085\u1680\u180e\u200b\u202f\u2060 + string is space \u0085\u1680\u180E\u200B\u202F\u2060 } {1} test utf-24.4 {unicode space char in regc_locale.c} { # this returns 1 with Unicode 7/TIP 413 compliance - list [regexp {^[[:space:]]+$} \u0085\u1680\u180e\u200b\u202f\u2060] [regexp {^\s+$} \u0085\u1680\u180e\u200b\u202f\u2060] + list [regexp {^[[:space:]]+$} \u0085\u1680\u180E\u200B\u202F\u2060] [regexp {^\s+$} \u0085\u1680\u180E\u200B\u202F\u2060] } {1 1} testConstraint teststringobj [llength [info commands teststringobj]] -- cgit v0.12 From 678d2103f907e0064ca38b7840d792bff8c0871a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 3 Dec 2019 13:20:47 +0000 Subject: Fix encoding-15.6 testacase for TCL_UTF_MAX=6, due to changes escape sequences for upper/lower surrogate combination. --- tests/encoding.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/encoding.test b/tests/encoding.test index 36fcff6..15aba11 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -342,8 +342,8 @@ test encoding-15.6 {UtfToUtfProc emoji character output} { set x \uDE02\uD83D\uDE02\uD83D set y [encoding convertto utf-8 \uDE02\uD83D\uDE02\uD83D] binary scan $y H* z - list [string length $x] [string length $y] $z -} {4 10 edb882f09f9882eda0bd} + list [string length $y] $z +} {10 edb882f09f9882eda0bd} test encoding-15.7 {UtfToUtfProc emoji character output} { set x \uDE02\uD83D\uD83D set y [encoding convertto utf-8 \uDE02\uD83D\uD83D] -- cgit v0.12