summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r--src/corelib/text/qstring.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index e56de8fd51..a915a7e3bb 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -4366,13 +4366,13 @@ qsizetype QString::lastIndexOf(const QRegularExpression &re, qsizetype from, QRe
return -1;
}
- qsizetype endpos = (from < 0) ? (size() + from + 1) : (from);
+ qsizetype endpos = (from < 0) ? (size() + from + 1) : (from + 1);
QRegularExpressionMatchIterator iterator = re.globalMatch(*this);
qsizetype lastIndex = -1;
while (iterator.hasNext()) {
QRegularExpressionMatch match = iterator.next();
qsizetype start = match.capturedStart();
- if (start <= endpos) {
+ if (start < endpos) {
lastIndex = start;
if (rmatch)
*rmatch = std::move(match);