validate: add missing yes/no boolean values
authorLuka Perkov <luka@openwrt.org>
Fri, 27 Jun 2014 08:09:04 +0000 (08:09 +0000)
committerJohn Crispin <blogic@openwrt.org>
Sat, 28 Jun 2014 21:16:51 +0000 (22:16 +0100)
Signed-off-by: Luka Perkov <luka@openwrt.org>
validate/cli.c

index a2a82edfae51b81d65c0aac952c8cc009bf52773..935b5f724881e00bfb018276854de78832d4eb4d 100644 (file)
@@ -22,9 +22,9 @@ print_usage(char *argv)
 static const char *
 bool_to_num(const char *val)
 {
-       if (!strcmp(val, "0") || !strcmp(val, "off") || !strcmp(val, "false") || !strcmp(val, "disabled"))
+       if (!strcmp(val, "0") || !strcmp(val, "off") || !strcmp(val, "false") || !strcmp(val, "no") || !strcmp(val, "disabled"))
                return "0";
-       if (!strcmp(val, "1") || !strcmp(val, "on") || !strcmp(val, "true") || !strcmp(val, "enabled"))
+       if (!strcmp(val, "1") || !strcmp(val, "on") || !strcmp(val, "true") || !strcmp(val, "yes") || !strcmp(val, "enabled"))
                return "1";
 
        return "";