From 3f82df43970c14a075f6590417f6b72ba5d3fe93 Mon Sep 17 00:00:00 2001 From: Robert Kessl Date: Thu, 24 Jul 2014 08:49:09 +0200 Subject: [PATCH] xtypes: bool now supports yes/no strings --- ucw/xtypes-basic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ucw/xtypes-basic.c b/ucw/xtypes-basic.c index 2792cd19..25d9fa84 100644 --- a/ucw/xtypes-basic.c +++ b/ucw/xtypes-basic.c @@ -138,6 +138,16 @@ static const char *xt_bool_parse(const char *str, void *dest, struct mempool *po return NULL; } + if(strcasecmp(str, "no") == 0) { + *((bool *)dest) = false; + return NULL; + } + + if(strcasecmp(str, "yes") == 0) { + *((bool *)dest) = true; + return NULL; + } + return "Could not parse bool."; } -- 2.39.5