From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/
Date: Wed, 25 Aug 2021 14:36:40 +0000 (UTC) [thread overview]
Message-ID: <1629902148.d0008990d9c734c1e5bfbb52a33babf382efc2ab.asturm@gentoo> (raw)
commit: d0008990d9c734c1e5bfbb52a33babf382efc2ab
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 25 12:54:55 2021 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Aug 25 14:35:48 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0008990
dev-qt/qtcore: Revert "QString::lastIndexOf: fix off-by-one ..."
"... for zero length matches"
See also:
https://bugreports.qt.io/browse/QTBUG-94215
https://invent.kde.org/qt/qt/qtbase/-/merge_requests/46
Package-Manager: Portage-3.0.22, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
.../files/qtcore-5.15.2-revert-3a273ac4.patch | 56 ++++++++++++++++++++++
dev-qt/qtcore/qtcore-5.15.2-r10.ebuild | 3 ++
2 files changed, 59 insertions(+)
diff --git a/dev-qt/qtcore/files/qtcore-5.15.2-revert-3a273ac4.patch b/dev-qt/qtcore/files/qtcore-5.15.2-revert-3a273ac4.patch
new file mode 100644
index 00000000000..a29e1b5256d
--- /dev/null
+++ b/dev-qt/qtcore/files/qtcore-5.15.2-revert-3a273ac4.patch
@@ -0,0 +1,56 @@
+From d9a85af5f24d0608c79b2d87b01213833bee01e5 Mon Sep 17 00:00:00 2001
+From: David Faure <david.faure@kdab.com>
+Date: Thu, 19 Aug 2021 15:07:13 +0200
+Subject: [PATCH] Revert "QString::lastIndexOf: fix off-by-one for zero length
+ matches"
+
+This reverts commit 3a273ac47f20e82a1f2f63411b210025ca0f4495.
+
+See QTBUG-94215
+
+6cee204d56205e250b0675c9c6d4dd8a2367f3c4 for qtbase/dev changes the
+behaviour even further, I'm pretty sure we don't want that in Qt 5.15.x,
+see discussion in https://codereview.qt-project.org/c/qt/qtbase/+/365179.
+
+Change-Id: I663d74e0d44ebf46291fe0e8a7dc609be82eedc6
+---
+ src/corelib/text/qstring.cpp | 4 ++--
+ tests/auto/corelib/text/qstring/tst_qstring.cpp | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
+index 02a9fe3a30..e6e7cbaad4 100644
+--- a/src/corelib/text/qstring.cpp
++++ b/src/corelib/text/qstring.cpp
+@@ -4558,13 +4558,13 @@ int QString::lastIndexOf(const QRegularExpression &re, int from, QRegularExpress
+ return -1;
+ }
+
+- int endpos = (from < 0) ? (size() + from + 1) : (from);
++ int endpos = (from < 0) ? (size() + from + 1) : (from + 1);
+ QRegularExpressionMatchIterator iterator = re.globalMatch(*this);
+ int lastIndex = -1;
+ while (iterator.hasNext()) {
+ QRegularExpressionMatch match = iterator.next();
+ int start = match.capturedStart();
+- if (start <= endpos) {
++ if (start < endpos) {
+ lastIndex = start;
+ if (rmatch)
+ *rmatch = std::move(match);
+diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp
+index 8f53824050..4c4a8f0416 100644
+--- a/tests/auto/corelib/text/qstring/tst_qstring.cpp
++++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp
+@@ -1674,7 +1674,7 @@ void tst_QString::lastIndexOf()
+ QCOMPARE(haystack.lastIndexOf(needle.toLatin1(), from, cs), expected);
+ QCOMPARE(haystack.lastIndexOf(needle.toLatin1().data(), from, cs), expected);
+
+- if (from >= -1 && from < haystack.size() && needle.size() > 0) {
++ if (from >= -1 && from < haystack.size()) {
+ // unfortunately, QString and QRegExp don't have the same out of bound semantics
+ // I think QString is wrong -- See file log for contact information.
+ {
+--
+GitLab
+
diff --git a/dev-qt/qtcore/qtcore-5.15.2-r10.ebuild b/dev-qt/qtcore/qtcore-5.15.2-r10.ebuild
index 5d5fc72d4cc..d8791013a67 100644
--- a/dev-qt/qtcore/qtcore-5.15.2-r10.ebuild
+++ b/dev-qt/qtcore/qtcore-5.15.2-r10.ebuild
@@ -48,6 +48,9 @@ QT5_GENTOO_PRIVATE_CONFIG=(
PATCHES=(
"${FILESDIR}"/${PN}-5.14.1-cmake-macro-backward-compat.patch # bug 703306
"${FILESDIR}"/${PN}-5.15.1-timezone-{1,2}.patch # bug 737914
+ # Revert to 5.15.2 (upstream Qt release) behavior, QTBUG-94215
+ # See also: https://invent.kde.org/qt/qt/qtbase/-/merge_requests/46
+ "${FILESDIR}"/${P}-revert-3a273ac4.patch
)
pkg_pretend() {
next reply other threads:[~2021-08-25 14:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-25 14:36 Andreas Sturmlechner [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-02-19 13:24 [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtcore/files/, dev-qt/qtcore/ Andreas Sturmlechner
2023-02-05 13:54 Andreas Sturmlechner
2022-06-26 8:25 Sam James
2022-03-30 18:57 Andreas Sturmlechner
2021-02-13 11:38 Andreas Sturmlechner
2021-01-02 1:23 Andreas Sturmlechner
2020-02-09 18:51 Andreas Sturmlechner
2020-01-25 23:56 Andreas Sturmlechner
2018-10-19 20:23 Andreas Sturmlechner
2017-11-28 11:00 Michael Palimaka
2017-05-14 0:14 Davide Pesavento
2017-04-23 19:08 Andreas Sturmlechner
2016-11-17 14:36 Michael Palimaka
2015-10-20 1:36 Davide Pesavento
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1629902148.d0008990d9c734c1e5bfbb52a33babf382efc2ab.asturm@gentoo \
--to=asturm@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox