sim: better handling of IMSI response

This is a port to git master of the following commit:

commit 0b051f9c7033143c56f59267794d1cadf4bd3416
Author: Dan Williams <dcbw@redhat.com>
Date:   Mon Aug 27 10:24:50 2012 -0500

    gsm: better handling of IMSI response

    Moto EZX devices prefix the response with "+CIMI:" while most
    devices do not.
This commit is contained in:
Aleksander Morgado
2012-08-31 10:08:11 +02:00
parent f53e53ba37
commit 19e91c5c79

View File

@@ -1074,7 +1074,9 @@ parse_imsi (const gchar *response,
g_assert (response != NULL);
for (s = response, len = 0; *s; ++s, ++len) {
for (s = mm_strip_tag (response, "+CIMI"), len = 0;
*s;
++s, ++len) {
/* IMSI is a number with 15 or less decimal digits. */
if (!isdigit (*s) || len > 15) {
g_set_error (error,