diff options
author | Nathan Williams <njw@chromium.org> | 2012-04-13 10:50:34 -0400 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-04-13 23:35:13 +0200 |
commit | 01a17f5c6c322f116e0a20647d3b9f2dc0276fef (patch) | |
tree | 5c4192b2d0f988ce96d9ca67a8db8d47083fc5f6 /src/mm-modem-helpers.c | |
parent | a07220650b7636fe1376d15580bab311710379ff (diff) |
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
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r-- | src/mm-modem-helpers.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 7302155e..a99eac35 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -1047,14 +1047,15 @@ mm_3gpp_parse_cnum_exec_response (const gchar *reply, if (!reply || !reply[0]) 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_regex_match (r, reply, 0, &match_info); while (g_match_info_matches (match_info)) { gchar *number; - number = g_match_info_fetch (match_info, 1); + number = g_match_info_fetch_named (match_info, "num"); if (number && number[0]) { if (!array) |