cli: fix ambiguity of "o" (on vs off) in nmc_string_to_bool()

This commit is contained in:
Jiří Klimeš
2014-05-14 16:33:28 +02:00
parent 66164c480d
commit e8f5a82e22
2 changed files with 6 additions and 0 deletions

View File

@@ -401,6 +401,12 @@ nmc_string_to_bool (const char *str, gboolean *val_bool, GError **error)
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (g_strcmp0 (str, "o") == 0) {
g_set_error (error, 1, 0,
_("'%s' is ambiguous (on x off)"), str);
return FALSE;
}
if (nmc_string_is_valid (str, s_true, NULL))
*val_bool = TRUE;
else if (nmc_string_is_valid (str, s_false, NULL))