Accepting request 1154135 from devel:languages:tcl

- Version 8.6.14:
  * Backport TIP #402: path name starting with '//' not replaced by
    '/' also on Cygwin and QNX
  * (bug) [8f7fde] string compare failing on big endian
  * (bug) [3e8074] y2k38 problem in [interp limit time -seconds]
  * (bug) [e3dcab] crash with tcl_precision equal 15..18
  * (bug) [d19fe0] output replacement character on incomplete
    sequences in unicode encoding
  * (bug) [534172] sporadic crash in memchan thread cleanup.
  * (bug) [f9eafc] throw error in zip command when file
    comment/filename to long or not iso-latin-1
  * (bug)[183a1a] Prevent BO by Tcl_UtfToExternal
  * (bug) [ea69b0], crash when using a channel transformation on
    TCP client socket
  * (bug)[026575] Prevent invalid read in Tcl_UtfToUniChar
  * (rfe) Allow empty mode in [chan create] to allow refchan
    version of [socket -server]
  * (bug) [ab123c] argument position overflow in [scan %num$mode]
  * (bug) [784bef] tailcall crash
  * (bug) [af3ebc] clock scan and clock add bugs in error cases /
    with abbreviated options
  * (bug) [66ffaf] incomplete double byte encoding sequences
    ignored like in [encoding convertfrom gb12345 x]
  * (rfe) [c54e4a] fork multithreading performance by using
    vfork/spawn when supported
  * Update libtommath to version 1.2.1
  * (bug) [60cacf] Fix tclvfs tkt Segmentation Fault at
    interpreter exit when tclvfs loaded.
  * (bug) [b5ac3e] Tcl_GetUniChar reads beyond string length for
    ASCII strings

OBS-URL: https://build.opensuse.org/request/show/1154135
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/tcl?expand=0&rev=70
This commit is contained in:
Dominique Leuenberger 2024-03-03 19:18:09 +00:00 committed by Git OBS Bridge
commit 5eb9e0abcc
7 changed files with 67 additions and 283 deletions

View File

@ -1,53 +0,0 @@
Index: generic/tclInterp.c
==================================================================
--- generic/tclInterp.c
+++ generic/tclInterp.c
@@ -4684,11 +4684,11 @@
case OPT_SEC:
if (Tcl_LimitTypeEnabled(childInterp, TCL_LIMIT_TIME)) {
Tcl_Time limitMoment;
Tcl_LimitGetTime(childInterp, &limitMoment);
- Tcl_SetObjResult(interp, Tcl_NewLongObj(limitMoment.sec));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(limitMoment.sec));
}
break;
}
return TCL_OK;
} else if ((objc-consumedObjc) & 1 /* isOdd(objc-consumedObjc) */) {
@@ -4742,28 +4742,30 @@
"BADVALUE", NULL);
return TCL_ERROR;
}
limitMoment.usec = ((long) tmp)*1000;
break;
- case OPT_SEC:
+ case OPT_SEC: {
+ Tcl_WideInt sec;
secObj = objv[i+1];
(void) Tcl_GetStringFromObj(objv[i+1], &secLen);
if (secLen == 0) {
break;
}
- if (TclGetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK) {
+ if (TclGetWideIntFromObj(interp, objv[i+1], &sec) != TCL_OK) {
return TCL_ERROR;
}
- if (tmp < 0) {
+ if (sec < 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"seconds must be at least 0", -1));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP",
"BADVALUE", NULL);
return TCL_ERROR;
}
- limitMoment.sec = tmp;
+ limitMoment.sec = sec;
break;
+ }
}
}
if (milliObj != NULL || secObj != NULL) {
if (milliObj != NULL) {
/*

View File

@ -1,84 +0,0 @@
--- doc/refchan.n.orig
+++ doc/refchan.n
@@ -53,8 +53,8 @@ here, then the \fBfinalize\fR subcommand
.PP
The \fImode\fR argument tells the handler whether the channel was
opened for reading, writing, or both. It is a list containing any of
-the strings \fBread\fR or \fBwrite\fR. The list will always
-contain at least one element.
+the strings \fBread\fR or \fBwrite\fR. The list may be empty, but
+will usually contain at least one element.
.PP
The subcommand must throw an error if the chosen mode is not
supported by the \fIcmdPrefix\fR.
--- generic/tclIORChan.c.orig
+++ generic/tclIORChan.c
@@ -532,7 +532,7 @@ TclChanCreateObjCmd(
/*
* First argument is a list of modes. Allowed entries are "read", "write".
- * Expect at least one list element. Abbreviations are ok.
+ * Empty list is uncommon, but allowed. Abbreviations are ok.
*/
modeObj = objv[MODE];
@@ -905,6 +905,11 @@ TclChanPostEventObjCmd(
if (EncodeEventMask(interp, "event", objv[EVENT], &events) != TCL_OK) {
return TCL_ERROR;
}
+ if (events == 0) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj("bad event list: is empty", -1));
+ return TCL_ERROR;
+ }
/*
* Check that the channel is actually interested in the provided events.
@@ -2007,10 +2012,10 @@ ReflectGetOption(
* EncodeEventMask --
*
* This function takes a list of event items and constructs the
- * equivalent internal bitmask. The list must contain at least one
- * element. Elements are "read", "write", or any unique abbreviation of
- * them. Note that the bitmask is not changed if problems are
- * encountered.
+ * equivalent internal bitmask. The list may be empty but will usually
+ * contain at least one element. Valid elements are "read", "write", or
+ * any unique abbreviation of them. Note that the bitmask is not changed
+ * if problems are encountered.
*
* Results:
* A standard Tcl error code. A bitmask where TCL_READABLE and/or
@@ -2040,12 +2045,6 @@ EncodeEventMask(
return TCL_ERROR;
}
- if (listc < 1) {
- Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "bad %s list: is empty", objName));
- return TCL_ERROR;
- }
-
events = 0;
while (listc > 0) {
if (Tcl_GetIndexFromObj(interp, listv[listc-1], eventOptions,
--- tests/ioCmd.test.orig
+++ tests/ioCmd.test
@@ -670,12 +670,12 @@ test iocmd-21.1 {chan create, wrong#args
catch {chan create a b c} msg
set msg
} {wrong # args: should be "chan create mode cmdprefix"}
-test iocmd-21.2 {chan create, invalid r/w mode, empty} {
- proc foo {} {}
- catch {chan create {} foo} msg
+test iocmd-21.2 {chan create, r/w mode empty} {
+ proc foo {cmd args} { return {initialize finalize watch} }
+ set chan [chan create {} foo]
+ close $chan
rename foo {}
- set msg
-} {bad mode list: is empty}
+} {}
test iocmd-21.3 {chan create, invalid r/w mode, bad string} {
proc foo {} {}
catch {chan create {c} foo} msg

View File

@ -1,133 +0,0 @@
--- generic/tclCmdMZ.c.orig
+++ generic/tclCmdMZ.c
@@ -2629,7 +2629,7 @@ StringEqualCmd(
*/
objv += objc-2;
- match = TclStringCmp(objv[0], objv[1], 0, nocase, reqlength);
+ match = TclStringCmp(objv[0], objv[1], 1, nocase, reqlength);
Tcl_SetObjResult(interp, Tcl_NewBooleanObj(match ? 0 : 1));
return TCL_OK;
}
@@ -2702,8 +2702,8 @@ TclStringCmp(
Tcl_Obj *value2Ptr,
int checkEq, /* comparison is only for equality */
int nocase, /* comparison is not case sensitive */
- int reqlength) /* requested length; -1 to compare whole
- * strings */
+ int reqlength) /* requested length in characters; -1 to
+ * compare whole strings */
{
const char *s1, *s2;
int empty, length, match, s1len, s2len;
@@ -2731,10 +2731,10 @@ TclStringCmp(
} else if ((value1Ptr->typePtr == &tclStringType)
&& (value2Ptr->typePtr == &tclStringType)) {
/*
- * Do a unicode-specific comparison if both of the args are of String
+ * Do a Unicode-specific comparison if both of the args are of String
* type. If the char length == byte length, we can do a memcmp. In
* benchmark testing this proved the most efficient check between the
- * unicode and string comparison operations.
+ * Unicode and string comparison operations.
*/
if (nocase) {
@@ -2748,6 +2748,9 @@ TclStringCmp(
&& (value1Ptr->bytes != NULL)
&& (s2len == value2Ptr->length)
&& (value2Ptr->bytes != NULL)) {
+ /* each byte represents one character so s1l3n, s2l3n, and
+ * reqlength are in both bytes and characters
+ */
s1 = value1Ptr->bytes;
s2 = value2Ptr->bytes;
memCmpFn = memcmp;
@@ -2756,14 +2759,17 @@ TclStringCmp(
s2 = (char *) Tcl_GetUnicode(value2Ptr);
if (
#if defined(WORDS_BIGENDIAN) && (TCL_UTF_MAX != 4)
- 1
+ 1
#else
- checkEq
+ checkEq
#endif /* WORDS_BIGENDIAN */
- ) {
+ ) {
memCmpFn = memcmp;
s1len *= sizeof(Tcl_UniChar);
s2len *= sizeof(Tcl_UniChar);
+ if (reqlength > 0) {
+ reqlength *= sizeof(Tcl_UniChar);
+ }
} else {
memCmpFn = (memCmpFn_t) Tcl_UniCharNcmp;
}
@@ -2805,7 +2811,7 @@ TclStringCmp(
s2 = TclGetStringFromObj(value2Ptr, &s2len);
}
- if (!nocase && checkEq) {
+ if (!nocase && checkEq && reqlength < 0) {
/*
* When we have equal-length we can check only for (in)equality.
* We can use memcmp() in all (n)eq cases because we don't need to
@@ -2826,24 +2832,28 @@ TclStringCmp(
s1len = Tcl_NumUtfChars(s1, s1len);
s2len = Tcl_NumUtfChars(s2, s2len);
memCmpFn = (memCmpFn_t)
- (nocase ? Tcl_UtfNcasecmp : Tcl_UtfNcmp);
+ (nocase ? Tcl_UtfNcasecmp : Tcl_UtfNcmp);
}
}
}
+ /* At this point s1len, s2len, and reqlength should by now have been
+ * adjusted so that they are all in the units expected by the selected
+ * comparison function.
+ */
+
length = (s1len < s2len) ? s1len : s2len;
if (reqlength > 0 && reqlength < length) {
length = reqlength;
} else if (reqlength < 0) {
/*
- * The requested length is negative, so we ignore it by setting it to
- * length + 1 so we correct the match var.
+ * The requested length is negative, so ignore it by setting it to
+ * length + 1 to correct the match var.
*/
-
reqlength = length + 1;
}
- if (checkEq && (s1len != s2len)) {
+ if (checkEq && reqlength < 0 && (s1len != s2len)) {
match = 1; /* This will be reversed below. */
} else {
/*
--- tests/stringComp.test.orig
+++ tests/stringComp.test
@@ -100,7 +100,7 @@ foreach {tname tbody tresult tcode} {
{unicode} {string compare \334 \u00fc} -1 {}
{unicode} {string compare \334\334\334\374\374 \334\334\334\334\334} 1 {}
{high bit} {
- # This test will fail if the underlying comparison
+ # This test fails if the underlying comparison
# is using signed chars instead of unsigned chars.
# (like SunOS's default memcmp thus the compat/memcmp.c)
string compare "\x80" "@"
@@ -156,10 +156,10 @@ foreach {tname tbody tresult tcode} {
{-nocase null strings} {
string compare -nocase foo ""
} 1 {}
- {with length, unequal strings} {
+ {with length, unequal strings, partial first string} {
string compare -length 2 abc abde
} 0 {}
- {with length, unequal strings} {
+ {with length, unequal strings 2, full first string} {
string compare -length 2 ab abde
} 0 {}
{with NUL character vs. other ASCII} {

View File

@ -1,3 +1,63 @@
-------------------------------------------------------------------
Fri Mar 1 16:52:58 UTC 2024 - Reinhard Max <max@suse.com>
- Version 8.6.14:
* Backport TIP #402: path name starting with '//' not replaced by
'/' also on Cygwin and QNX
* (bug) [8f7fde] string compare failing on big endian
* (bug) [3e8074] y2k38 problem in [interp limit time -seconds]
* (bug) [e3dcab] crash with tcl_precision equal 15..18
* (bug) [d19fe0] output replacement character on incomplete
sequences in unicode encoding
* (bug) [534172] sporadic crash in memchan thread cleanup.
* (bug) [f9eafc] throw error in zip command when file
comment/filename to long or not iso-latin-1
* (bug)[183a1a] Prevent BO by Tcl_UtfToExternal
* (bug) [ea69b0], crash when using a channel transformation on
TCP client socket
* (bug)[026575] Prevent invalid read in Tcl_UtfToUniChar
* (rfe) Allow empty mode in [chan create] to allow refchan
version of [socket -server]
* (bug) [ab123c] argument position overflow in [scan %num$mode]
* (bug) [784bef] tailcall crash
* (bug) [af3ebc] clock scan and clock add bugs in error cases /
with abbreviated options
* (bug) [66ffaf] incomplete double byte encoding sequences
ignored like in [encoding convertfrom gb12345 x]
* (rfe) [c54e4a] fork multithreading performance by using
vfork/spawn when supported
* Update libtommath to version 1.2.1
* (bug) [60cacf] Fix tclvfs tkt Segmentation Fault at
interpreter exit when tclvfs loaded.
* (bug) [b5ac3e] Tcl_GetUniChar reads beyond string length for
ASCII strings
* Unicode 15.1
* (bug) [00655c] ClockGetdatefieldsObjCmd(): avoid signed integer
overflow and platform-dependent behavior
* TIP #662: Tcl_VarEval is not depreciated any more
* (bug) [7b3167] tclOO.c: initialize fakeObject.refCount
* (bug) [7371b6] AddressSanitizer use-after-return detection
breaks NRE tests, coroutines
* (bug)[32b889] prevent spurious errors from [clock format]
* (rfe) [0ac9d0] Don't call getsockname(2) in
Tcl_MakeFileChannel(3) unless absolutely necessary. Permits
better constraining of Tcl/tclsh via OpenBSD's pledge(2) or
similar mechanisms. Minor rewrite.
* (feature) Adapt tcltest to support Tcl 9.
* (bug) [fd27ad] doc change of Tcl_PkgRequire & friends: version
string specification refers to "package require".
* (bug) [16e25e] error for
[tcl_startOfPreviousWord string end-1]
* [db4f28] segfault when Tcl_ReadChars is called with unicode
object
* fix/document Tcl_ObjPrintf with "ll" modifier
* [8e666d] endless loop when redefining proc ::history
* [86b3c1] endless loop when ::unknown is moved into a namespace
- Obsoleted patches:
* tcl-interp-limit-time.patch
* tcl-refchan-mode-needed.patch
* tcl-string-compare.patch
-------------------------------------------------------------------
Thu Mar 30 09:30:57 UTC 2023 - Reinhard Max <max@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package tcl
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -22,11 +22,11 @@
Name: tcl
URL: http://www.tcl.tk
Version: 8.6.13
Version: 8.6.14
Release: 0
%define rrc %{nil}
%define TCL_MINOR %(echo %version | cut -c1-3)
%define itclver 4.2.3
%define itclver 4.2.4
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: The Tcl Programming Language
License: TCL
@ -48,9 +48,6 @@ Source0: http://prdownloads.sourceforge.net/tcl/%{name}%{version}%{rrc}-s
Source1: tcl-rpmlintrc
Source2: baselibs.conf
Source3: macros.tcl
Patch0: tcl-refchan-mode-needed.patch
Patch1: tcl-string-compare.patch
Patch2: tcl-interp-limit-time.patch
BuildRequires: autoconf
BuildRequires: pkg-config
BuildRequires: zlib-devel
@ -91,12 +88,9 @@ the Tcl language itself.
%prep
%setup -q -n %name%version
if ! test -d pkgs/itcl%itclver; then
: Version mismatch in itcl, please chek the %%itclver macro!
: New itcl version: pkgs/itcl* . Please update the %%itclver macro acordingly.
exit 1
fi
%patch0
%patch1
%patch2
# The SQLite extension is provided by the sqlite3 package,
# so don't build it here.

BIN
tcl8.6.13-src.tar.gz (Stored with Git LFS)

Binary file not shown.

3
tcl8.6.14-src.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5880225babf7954c58d4fb0f5cf6279104ce1cd6aa9b71e9a6322540e1c4de66
size 11627322