From 159cb3d31d8b70d7ef29798372421c08c9274a85 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 21 Sep 2022 18:23:14 +0000 Subject: Another test related to TIP 623. --- tests/stringObj.test | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/stringObj.test b/tests/stringObj.test index b799828..dce932b 100644 --- a/tests/stringObj.test +++ b/tests/stringObj.test @@ -505,6 +505,11 @@ test stringObj-16.5 {Tcl_GetRange: fist = last = -1} testobj { teststringobj set 1 abcde teststringobj range 1 -1 -1 } abcde +test stringObj-16.6 {Tcl_GetRange: old anomaly} testobj { + # Older implementations could return "cde" + teststringobj set 1 abcde + teststringobj range 1 2 0 +} {} if {[testConstraint testobj]} { -- cgit v0.12 From 9babdebe9d5537c0026d149ca8810b9ffad51d0d Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 21 Sep 2022 18:38:51 +0000 Subject: Update docs and comments to agree with TIP 623. --- doc/StringObj.3 | 4 +++- generic/tclStringObj.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/StringObj.3 b/doc/StringObj.3 index 7870b21..90678c4 100644 --- a/doc/StringObj.3 +++ b/doc/StringObj.3 @@ -211,7 +211,9 @@ appropriate range. characters between \fIfirst\fR and \fIlast\fR (inclusive) in the value's Unicode representation. If the value's Unicode representation is invalid, the Unicode representation is regenerated -from the value's string representation. +from the value's string representation. If \fIfirst\fR < 0, then +the returned string starts at the beginning of the value. If \fIlast\fR < 0, +then the returned string ends at the end of the value. .PP \fBTcl_GetCharLength\fR returns the number of characters (as opposed to bytes) in the string value. diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index b81e711..b109808 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -739,7 +739,9 @@ Tcl_GetUnicodeFromObj( * * Create a Tcl Object that contains the chars between first and last of * the object indicated by "objPtr". If the object is not already a - * String object, convert it to one. + * String object, convert it to one. If first is negative, the returned + * string start at the beginning of objPtr. If last is negative, the + * returned string ends at the end of objPtr. * * Results: * Returns a new Tcl Object of the String type. -- cgit v0.12 From cccb9994ce059b965d7537c824ddd63a839f8c21 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 22 Sep 2022 12:30:11 +0000 Subject: Fix [22ab2ae64a]: Build with minizip broken (actually, only a problem in 8.7, but let's keep tinydir.h the same in all branches) --- compat/zlib/contrib/minizip/tinydir.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/compat/zlib/contrib/minizip/tinydir.h b/compat/zlib/contrib/minizip/tinydir.h index ba20c3e..b8133ac 100644 --- a/compat/zlib/contrib/minizip/tinydir.h +++ b/compat/zlib/contrib/minizip/tinydir.h @@ -546,12 +546,6 @@ int tinydir_readfile(const tinydir_dir *dir, tinydir_file *file) #ifndef _MSC_VER #ifdef __MINGW32__ if (_tstat( -#elif (defined _BSD_SOURCE) || (defined _DEFAULT_SOURCE) \ - || ((defined _XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) \ - || ((defined _POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) \ - || ((defined __APPLE__) && (defined __MACH__)) \ - || (defined BSD) - if (lstat( #else if (stat( #endif -- cgit v0.12