>From d315cccd5404b6f26b31111f57b7f83063b0213b Mon Sep 17 00:00:00 2001
From: Bettina Riedl <bettina-jennifer.ri...@expleogroup.com>
Date: Fri, 3 Sep 2021 11:38:43 +0200
Subject: [PATCH] Match AT commands with exactMatch

Use QRegEx's exactMatch method instead of indexIn to prevent matching
only the front part of an AT command.
---
 src/phonesim.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index 89d5e9d..151ceca 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -313,8 +313,7 @@ bool SimChat::command( const QString& cmd )
     QString _ecommand = state()->rules()->expand(_command);
 
     if ( wildcard ) {
-        int
s=QRegExp(_ecommand,Qt::CaseSensitive,QRegExp::Wildcard).indexIn(cmd,0);
-        if (s==0) {
+        if
(QRegExp(_ecommand,Qt::CaseSensitive,QRegExp::Wildcard).exactMatch(cmd)) {
             int w=_ecommand.indexOf(QChar('*'));
             while(w <= 2 && w >= 0)
                 w=_ecommand.indexOf(QChar('*'),w+1);
-- 
2.25.1

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
ofono mailing list -- ofono@ofono.org
To unsubscribe send an email to ofono-le...@ofono.org

Reply via email to