From e8f5a82e224348e4865d9eb81982d2cda064bcec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 14 May 2014 16:33:28 +0200 Subject: [PATCH] cli: fix ambiguity of "o" (on vs off) in nmc_string_to_bool() --- cli/src/utils.c | 6 ++++++ vim | 0 2 files changed, 6 insertions(+) create mode 100644 vim diff --git a/cli/src/utils.c b/cli/src/utils.c index 8b7554142..9c4591227 100644 --- a/cli/src/utils.c +++ b/cli/src/utils.c @@ -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)) diff --git a/vim b/vim new file mode 100644 index 000000000..e69de29bb