From a1947aeffe158a0ea7de3ced1bf8d6a4719a27ef Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 3 Apr 2020 17:11:36 +0200 Subject: Port qmake over to user QRegularExpression Use the DotMatchesEverythingOption for all places where we interpret .pro files, to increase compatibility with QRegExp. Change-Id: I347d6b17858069f3c9cedcedd04df58358d83f27 Reviewed-by: Joerg Bornemann --- qmake/option.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'qmake/option.cpp') diff --git a/qmake/option.cpp b/qmake/option.cpp index 9ec2fe6411..2d5ef9dfd6 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -30,7 +30,7 @@ #include "cachekeys.h" #include #include -#include +#include #include #include #include @@ -519,12 +519,14 @@ Option::fixString(QString string, uchar flags) //fix the environment variables if(flags & Option::FixEnvVars) { - int rep; - static QRegExp reg_var("\\$\\(.*\\)"); - reg_var.setMinimal(true); - while((rep = reg_var.indexIn(string)) != -1) - string.replace(rep, reg_var.matchedLength(), - QString::fromLocal8Bit(qgetenv(string.mid(rep + 2, reg_var.matchedLength() - 3).toLatin1().constData()).constData())); + static QRegularExpression reg_var("\\$\\(.*\\)", QRegularExpression::InvertedGreedinessOption); + QRegularExpressionMatch match; + while ((match = reg_var.match(string)).hasMatch()) { + int start = match.capturedStart(); + int len = match.capturedLength(); + string.replace(start, len, + QString::fromLocal8Bit(qgetenv(string.mid(start + 2, len - 3).toLatin1().constData()).constData())); + } } //canonicalize it (and treat as a path) -- cgit v1.2.3