From 111f13d29345f2e4998be82a7d8baaf9d24c4b605f4e8e21d450bf33bf92299c Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 22 Nov 2021 11:30:50 +0000 Subject: [PATCH 1/2] Accepting request 933002 from home:Andreas_Schwab:Factory - fix-ucptrietest-golden-diff.patch: ICU-21793 Fix ucptrietest golden diff OBS-URL: https://build.opensuse.org/request/show/933002 OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/icu?expand=0&rev=153 --- fix-ucptrietest-golden-diff.patch | 42 +++++++++++++++++++++++++++++++ icu.changes | 5 ++++ icu.spec | 1 + 3 files changed, 48 insertions(+) create mode 100644 fix-ucptrietest-golden-diff.patch diff --git a/fix-ucptrietest-golden-diff.patch b/fix-ucptrietest-golden-diff.patch new file mode 100644 index 0000000..1f4963a --- /dev/null +++ b/fix-ucptrietest-golden-diff.patch @@ -0,0 +1,42 @@ +From 698efda42bb21a9da1c92348d3e73466c8a528fe Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= +Date: Wed, 3 Nov 2021 02:31:18 +0100 +Subject: [PATCH] ICU-21793 Fix ucptrietest golden diff + +--- + icu4c/source/tools/toolutil/toolutil.cpp | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/icu4c/source/tools/toolutil/toolutil.cpp b/icu4c/source/tools/toolutil/toolutil.cpp +index 1fc68aa69c..a9dc37377a 100644 +--- icu4c/source/tools/toolutil/toolutil.cpp ++++ icu4c/source/tools/toolutil/toolutil.cpp +@@ -228,18 +228,19 @@ uprv_compareGoldenFiles( + std::ifstream ifs(goldenFilePath, std::ifstream::in); + int32_t pos = 0; + char c; +- while ((c = ifs.get()) != std::char_traits::eof() && pos < bufferLen) { ++ while (ifs.get(c) && pos < bufferLen) { + if (c != buffer[pos]) { + // Files differ at this position +- return pos; ++ break; + } + pos++; + } +- if (pos < bufferLen || c != std::char_traits::eof()) { +- // Files are different lengths +- return pos; ++ if (pos == bufferLen && ifs.eof()) { ++ // Files are same lengths ++ pos = -1; + } +- return -1; ++ ifs.close(); ++ return pos; + } + + /*U_CAPI UDate U_EXPORT2 +-- +2.34.0 + diff --git a/icu.changes b/icu.changes index c897136..4e472c4 100644 --- a/icu.changes +++ b/icu.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Nov 22 10:22:02 UTC 2021 - Andreas Schwab + +- fix-ucptrietest-golden-diff.patch: ICU-21793 Fix ucptrietest golden diff + ------------------------------------------------------------------- Tue Nov 9 15:39:14 UTC 2021 - Callum Farmer diff --git a/icu.spec b/icu.spec index 268a29c..8e6a463 100644 --- a/icu.spec +++ b/icu.spec @@ -45,6 +45,7 @@ Patch6: icu-error-reporting.diff Patch7: icu-avoid-x87-excess-precision.diff Patch8: locale.diff Patch9: nan-undefined-conversion.patch +Patch10: fix-ucptrietest-golden-diff.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: pkg-config From 5dd7f3cbea717cb026163f8f6c0e54f05e38b9e1ae51d15183ed4aa3621e95e0 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 22 Nov 2021 11:31:37 +0000 Subject: [PATCH 2/2] add bug ref OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/icu?expand=0&rev=154 --- fix-ucptrietest-golden-diff.patch | 1 + icu.changes | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fix-ucptrietest-golden-diff.patch b/fix-ucptrietest-golden-diff.patch index 1f4963a..1c68140 100644 --- a/fix-ucptrietest-golden-diff.patch +++ b/fix-ucptrietest-golden-diff.patch @@ -2,6 +2,7 @@ From 698efda42bb21a9da1c92348d3e73466c8a528fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= Date: Wed, 3 Nov 2021 02:31:18 +0100 Subject: [PATCH] ICU-21793 Fix ucptrietest golden diff +References: https://bugzilla.opensuse.org/show_bug.cgi?id=1192935 --- icu4c/source/tools/toolutil/toolutil.cpp | 13 +++++++------ diff --git a/icu.changes b/icu.changes index 4e472c4..39c9e3e 100644 --- a/icu.changes +++ b/icu.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- Mon Nov 22 10:22:02 UTC 2021 - Andreas Schwab -- fix-ucptrietest-golden-diff.patch: ICU-21793 Fix ucptrietest golden diff +- Add fix-ucptrietest-golden-diff.patch: ICU-21793 Fix + ucptrietest golden diff [boo#1192935] ------------------------------------------------------------------- Tue Nov 9 15:39:14 UTC 2021 - Callum Farmer