From cbac89b0fd69eed5750933a325618503a7c1e03e Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 11 Jun 2020 15:23:04 +0200 Subject: [PATCH] QtcProcess: Port to QRegularExpression Task-number: QTCREATORBUG-24098 Change-Id: I9784989786ff65ceac6c9921f7f9f09d4e0f0a49 Reviewed-by: Christian Stenger --- src/libs/utils/qtcprocess.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/qtcprocess.cpp b/src/libs/utils/qtcprocess.cpp index 2088ae408fc..3855ee631ee 100644 --- a/src/libs/utils/qtcprocess.cpp +++ b/src/libs/utils/qtcprocess.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #ifdef Q_OS_WIN @@ -583,7 +583,7 @@ static QString quoteArgWin(const QString &arg) // Quotes are escaped and their preceding backslashes are doubled. // It's impossible to escape anything inside a quoted string on cmd // level, so the outer quoting must be "suspended". - ret.replace(QRegExp(QLatin1String("(\\\\*)\"")), QLatin1String("\"\\1\\1\\^\"\"")); + ret.replace(QRegularExpression(QLatin1String("(\\\\*)\"")), QLatin1String("\"\\1\\1\\^\"\"")); // The argument must not end with a \ since this would be interpreted // as escaping the quote -- rather put the \ behind the quote: e.g. // rather use "foo"\ than "foo\" @@ -1062,7 +1062,7 @@ bool QtcProcess::expandMacros(QString *cmd, AbstractMacroExpander *mx, OsType os // Our expansion rules trigger in any context if (state.dquote) { // We are within a double-quoted string. Escape relevant meta characters. - rsts.replace(QRegExp(QLatin1String("([$`\"\\\\])")), QLatin1String("\\\\1")); + rsts.replace(QRegularExpression(QLatin1String("([$`\"\\\\])")), QLatin1String("\\\\1")); } else if (state.current == MxSingleQuote) { // We are within a single-quoted string. "Suspend" single-quoting and put a // single escaped quote for each single quote inside the string.