summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qregularexpression.cpp
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@idiap.ch>2018-12-14 20:59:55 +0100
committerSamuel Gaist <samuel.gaist@idiap.ch>2018-12-15 13:24:16 +0000
commit649ee12aba2ee92781f0ab888d21a1bdb440b7da (patch)
treee6217e716b5848bee147f76edac18b0585490968 /src/corelib/tools/qregularexpression.cpp
parente80bf655e922e9864f8843b5e7bbb47019a6d95a (diff)
QRegularExpression: anchor wildcard pattern
The current implementation of wildcardToRegularExpression doesn't anchor the pattern which makes it not narrow enough for globbing patterns. This patch fixes that by applying anchoredPattern before returning the wildcard pattern. [ChangeLog][QtCore][QRegularExpression] The wildcardToRegularExpression method now returns a properly anchored pattern. Change-Id: I7bee73389d408cf42499652e4fb854517a8125b5 Fixes: QTBUG-72539 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qregularexpression.cpp')
-rw-r--r--src/corelib/tools/qregularexpression.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index 908e7ff0d6..831fa28de0 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -1992,7 +1992,7 @@ QString QRegularExpression::wildcardToRegularExpression(const QString &pattern)
}
}
- return rx;
+ return anchoredPattern(rx);
}
/*!