From 19e91c5c79f5f824c309c8d11c0b148ca8b0955e Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 31 Aug 2012 10:08:11 +0200 Subject: sim: better handling of IMSI response This is a port to git master of the following commit: commit 0b051f9c7033143c56f59267794d1cadf4bd3416 Author: Dan Williams 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. --- src/mm-sim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mm-sim.c b/src/mm-sim.c index a63fdfba..7cdb356b 100644 --- a/src/mm-sim.c +++ b/src/mm-sim.c @@ -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, -- cgit v1.2.3-70-g09d2