From 583f7491036e29751119e671b45f1d920f6cc98c0010f0ca01d80cadc36ba6b1 Mon Sep 17 00:00:00 2001 From: Reinhard Max Date: Fri, 23 Dec 2022 16:06:16 +0000 Subject: [PATCH] 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 --- tcl-string-compare.patch | 30 ++++++++++++++++++++++++++++++ tcl.changes | 6 ++++++ tcl.spec | 2 ++ 3 files changed, 38 insertions(+) create mode 100644 tcl-string-compare.patch diff --git a/tcl-string-compare.patch b/tcl-string-compare.patch new file mode 100644 index 0000000..f15d3b7 --- /dev/null +++ b/tcl-string-compare.patch @@ -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 + diff --git a/tcl.changes b/tcl.changes index 5ce0d6d..a38f5c7 100644 --- a/tcl.changes +++ b/tcl.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Dec 23 15:50:47 UTC 2022 - Reinhard Max + +- 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 diff --git a/tcl.spec b/tcl.spec index f02ce41..c364601 100644 --- a/tcl.spec +++ b/tcl.spec @@ -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.