summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLC <mathew1800@gmail.com>2021-02-02 22:00:11 -0500
committerGitHub <noreply@github.com>2021-02-02 22:00:11 -0500
commit7250d6e4e091f4b5b4f2289c2c732349b69a2e8a (patch)
treed69e8b3a29b871a48d6a6561eaea73c0ec302cce /Source/Core
parent9d04fd1ccbb2973777cec14c4244f6a002e1da41 (diff)
parent77c68a3142faf20d03c37bd1a71d4c05d39c4a29 (diff)
Merge pull request #9487 from iwubcode/qt_regex_regression
DolphinQt: Fix regression in input expressions
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt/Config/Mapping/MappingCommon.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Core/DolphinQt/Config/Mapping/MappingCommon.cpp b/Source/Core/DolphinQt/Config/Mapping/MappingCommon.cpp
index 3678cceb89..6765485c10 100644
--- a/Source/Core/DolphinQt/Config/Mapping/MappingCommon.cpp
+++ b/Source/Core/DolphinQt/Config/Mapping/MappingCommon.cpp
@@ -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);
}