Accepting request 1045043 from home:rmax:branches:devel:languages:tcl

- bsc#1206623, tcl-string-compare.patch: Fix a bug in string
  comparison on big endian that made test string-2.20.1 fail.

OBS-URL: https://build.opensuse.org/request/show/1045043
OBS-URL: https://build.opensuse.org/package/show/devel:languages:tcl/tcl?expand=0&rev=149
This commit is contained in:
Reinhard Max 2022-12-23 16:06:16 +00:00 committed by Git OBS Bridge
parent 5b089007e5
commit 583f749103
3 changed files with 38 additions and 0 deletions

30
tcl-string-compare.patch Normal file
View File

@ -0,0 +1,30 @@
Index: generic/tclCmdMZ.c
==================================================================
--- generic/tclCmdMZ.c
+++ generic/tclCmdMZ.c
@@ -2752,23 +2752,11 @@
s2 = value2Ptr->bytes;
memCmpFn = memcmp;
} else {
s1 = (char *) Tcl_GetUnicode(value1Ptr);
s2 = (char *) Tcl_GetUnicode(value2Ptr);
- if (
-#if defined(WORDS_BIGENDIAN) && (TCL_UTF_MAX != 4)
- 1
-#else
- checkEq
-#endif /* WORDS_BIGENDIAN */
- ) {
- memCmpFn = memcmp;
- s1len *= sizeof(Tcl_UniChar);
- s2len *= sizeof(Tcl_UniChar);
- } else {
- memCmpFn = (memCmpFn_t) Tcl_UniCharNcmp;
- }
+ memCmpFn = (memCmpFn_t) Tcl_UniCharNcmp;
}
}
} else {
/*
* Get the string representations, being careful in case we have

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Dec 23 15:50:47 UTC 2022 - Reinhard Max <max@suse.com>
- bsc#1206623, tcl-string-compare.patch: Fix a bug in string
comparison on big endian that made test string-2.20.1 fail.
-------------------------------------------------------------------
Wed Nov 23 16:05:02 UTC 2022 - Reinhard Max <max@suse.com>

View File

@ -49,6 +49,7 @@ Source1: tcl-rpmlintrc
Source2: baselibs.conf
Source3: macros.tcl
Patch0: tcl-refchan-mode-needed.patch
Patch1: tcl-string-compare.patch
BuildRequires: autoconf
BuildRequires: pkg-config
BuildRequires: zlib-devel
@ -93,6 +94,7 @@ if ! test -d pkgs/itcl%itclver; then
exit 1
fi
%patch0
%patch1
# The SQLite extension is provided by the sqlite3 package,
# so don't build it here.