Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9487 from iwubcode/qt_regex_regression
DolphinQt: Fix regression in input expressions
  • Loading branch information
lioncash committed Feb 3, 2021
2 parents 9d04fd1 + 77c68a3 commit 7250d6e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/Core/DolphinQt/Config/Mapping/MappingCommon.cpp
Expand Up @@ -51,8 +51,10 @@ QString GetExpressionForControl(const QString& control_name,

if (quote == Quote::On)
{
const QRegularExpression reg(QStringLiteral("[a-zA-Z]+"));
if (!reg.match(expr).hasMatch())
// If our expression contains any non-alpha characters
// we should quote it
const QRegularExpression reg(QStringLiteral("[^a-zA-Z]"));
if (reg.match(expr).hasMatch())
expr = QStringLiteral("`%1`").arg(expr);
}

Expand Down

0 comments on commit 7250d6e

Please sign in to comment.