diff options
author | Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com> | 2011-10-05 16:18:26 +0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-10-12 16:24:03 -0500 |
commit | 1e44b29de9039955e66c3eebaa1fef8120d197e7 (patch) | |
tree | b431817052601d182f1f415f8205c37ac22c79bf | |
parent | 8f26272f013467263e4bbe40555e687194e6d37e (diff) | |
download | ofono-1e44b29de9039955e66c3eebaa1fef8120d197e7.tar.bz2 |
mbpi: Reflow gsm_end()
-rw-r--r-- | plugins/mbpi.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/plugins/mbpi.c b/plugins/mbpi.c index 3a0be25f..5b10c1a5 100644 --- a/plugins/mbpi.c +++ b/plugins/mbpi.c @@ -270,35 +270,37 @@ static void gsm_start(GMarkupParseContext *context, const gchar *element_name, static void gsm_end(GMarkupParseContext *context, const gchar *element_name, gpointer userdata, GError **error) { - struct gsm_data *gsm = userdata; + struct gsm_data *gsm; + struct ofono_gprs_provision_data *apn; + + if (!g_str_equal(element_name, "apn")) + return; - if (g_str_equal(element_name, "apn")) { - struct ofono_gprs_provision_data *apn = - g_markup_parse_context_pop(context); + gsm = userdata; - if (apn == NULL) - return; + apn = g_markup_parse_context_pop(context); + if (apn == NULL) + return; - if (gsm->allow_duplicates == FALSE) { - GSList *l; + if (gsm->allow_duplicates == FALSE) { + GSList *l; - for (l = gsm->apns; l; l = l->next) { - struct ofono_gprs_provision_data *pd = l->data; + for (l = gsm->apns; l; l = l->next) { + struct ofono_gprs_provision_data *pd = l->data; - if (pd->type != apn->type) - continue; + if (pd->type != apn->type) + continue; - g_set_error(error, mbpi_error_quark(), - MBPI_ERROR_DUPLICATE, - "Duplicate context detected"); + g_set_error(error, mbpi_error_quark(), + MBPI_ERROR_DUPLICATE, + "Duplicate context detected"); - mbpi_provision_data_free(apn); - return; - } + mbpi_provision_data_free(apn); + return; } - - gsm->apns = g_slist_append(gsm->apns, apn); } + + gsm->apns = g_slist_append(gsm->apns, apn); } static const GMarkupParser gsm_parser = { |