cinterion: allow '*' in Prov/Cfg response

E.g. in a Cinterion PLS8-E (REVISION 04.004) to match the following
line:

  ^SCFG: "MEopMode/Prov/Cfg","fallback*"

Fix suggested by Jan Mazura.

See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/347
This commit is contained in:
Aleksander Morgado
2021-03-21 11:24:18 +01:00
parent 192e067f97
commit 5285e958ab
2 changed files with 6 additions and 1 deletions

View File

@@ -1515,7 +1515,7 @@ mm_cinterion_provcfg_response_to_cid (const gchar *response,
g_autoptr(GMatchInfo) match_info = NULL;
g_autofree gchar *mno = NULL;
r = g_regex_new ("\\^SCFG:\\s*\"MEopMode/Prov/Cfg\",\\s*\"([0-9a-zA-Z]*)\"", 0, 0, NULL);
r = g_regex_new ("\\^SCFG:\\s*\"MEopMode/Prov/Cfg\",\\s*\"([0-9a-zA-Z*]*)\"", 0, 0, NULL);
g_assert (r != NULL);
if (!g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, error))

View File

@@ -1636,6 +1636,11 @@ static const ProvcfgResponseTest provcfg_response_tests[] = {
.str = "* ^SCFG: \"MEopMode/Prov/Cfg\",\"tmode\"",
.modem_family = MM_CINTERION_MODEM_FAMILY_DEFAULT,
.expected_cid = 2,
},
{
.str = "* ^SCFG: \"MEopMode/Prov/Cfg\",\"fallback*\"",
.modem_family = MM_CINTERION_MODEM_FAMILY_DEFAULT,
.expected_cid = 1,
}
};