helpers: adjust parsing of +CNUM response to permit spaces in the alphanumeric descriptor.
This permits matching a response such as '"Line 1","+19999999999",145', which previously did not match. Change-Id: I666af8774507c6c3b3e214b820449542065dd8b4
This commit is contained in:

committed by
Aleksander Morgado

parent
a07220650b
commit
01a17f5c6c
@@ -1047,14 +1047,15 @@ mm_3gpp_parse_cnum_exec_response (const gchar *reply,
|
|||||||
if (!reply || !reply[0])
|
if (!reply || !reply[0])
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
r = g_regex_new ("\\+CNUM:\\s*\"?\\S*\"?,\"(\\S+)\",\\d", G_REGEX_UNGREEDY, 0, NULL);
|
r = g_regex_new ("\\+CNUM:\\s*((\"([^\"]|(\\\"))*\")|([^,]*)),\"(?<num>\\S+)\",\\d",
|
||||||
|
G_REGEX_UNGREEDY, 0, NULL);
|
||||||
g_assert (r != NULL);
|
g_assert (r != NULL);
|
||||||
|
|
||||||
g_regex_match (r, reply, 0, &match_info);
|
g_regex_match (r, reply, 0, &match_info);
|
||||||
while (g_match_info_matches (match_info)) {
|
while (g_match_info_matches (match_info)) {
|
||||||
gchar *number;
|
gchar *number;
|
||||||
|
|
||||||
number = g_match_info_fetch (match_info, 1);
|
number = g_match_info_fetch_named (match_info, "num");
|
||||||
|
|
||||||
if (number && number[0]) {
|
if (number && number[0]) {
|
||||||
if (!array)
|
if (!array)
|
||||||
|
Reference in New Issue
Block a user