diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2020-01-06 14:39:45 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2020-01-06 14:51:40 +0100 |
commit | 6ca462f97bf39bc872873a33dd89ead086ac1380 (patch) | |
tree | db5b7bd5ab9d18cb8ccad4db51806faa1e459930 | |
parent | 45d3f05f3dea14e348cb43dea67ee56b0e80a77f (diff) |
libmm-glib,common-helpers: allow yes/no as booleans in stringmm-1-10
E.g. so that the settings passed on Simple.Connect() or
Bearer.Connect() are parsed correctly from the user string:
daemon.notice netifd: wan (30476): simple connect=apn=internet,ip-type=ipv4,allow-roaming=yes
daemon.notice netifd: wan (30476): Error parsing connect string:
'Invalid properties string, unexpected key 'allow-roaming''
This also goes inline with e.g. the --create-bearer help in the man
page that suggests using yes/no for the allow-roaming setting.
(cherry picked from commit 15e8a78a15e458efae781d4905134e07043aad25)
-rw-r--r-- | libmm-glib/mm-common-helpers.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libmm-glib/mm-common-helpers.c b/libmm-glib/mm-common-helpers.c index 67a310f3..be79fc85 100644 --- a/libmm-glib/mm-common-helpers.c +++ b/libmm-glib/mm-common-helpers.c @@ -938,10 +938,10 @@ gboolean mm_common_get_boolean_from_string (const gchar *value, GError **error) { - if (!g_ascii_strcasecmp (value, "true") || g_str_equal (value, "1")) + if (!g_ascii_strcasecmp (value, "true") || g_str_equal (value, "1") || !g_ascii_strcasecmp (value, "yes")) return TRUE; - if (!g_ascii_strcasecmp (value, "false") || g_str_equal (value, "0")) + if (!g_ascii_strcasecmp (value, "false") || g_str_equal (value, "0") || !g_ascii_strcasecmp (value, "no")) return FALSE; g_set_error (error, |