From e417368c4f1a1c69f1d6d2279219f9a1c2939457 Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 15 Sep 2009 18:59:50 +0000 Subject: [PATCH] add support for "yes" and "no" as boolean values --- doc/infosrc/attrs.1 | 4 ++-- lib/common/utils.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/infosrc/attrs.1 b/doc/infosrc/attrs.1 index 4be5d3003..b4ea56b6f 100644 --- a/doc/infosrc/attrs.1 +++ b/doc/infosrc/attrs.1 @@ -60,8 +60,8 @@ or arrowhead attributes. The tools accept standard C representations for int and double types. For the bool type, TRUE values are -represented by "true" (case-insensitive) -and any non-zero integer, and FALSE values by "false" (case-insensitive) +represented by "true" or "yes" (case-insensitive) +and any non-zero integer, and FALSE values by "false" or "no" (case-insensitive) and zero. In addition, there are a variety of specialized types such as arrowType, color, diff --git a/lib/common/utils.c b/lib/common/utils.c index ac1abb2f2..175e9843d 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -435,8 +435,12 @@ boolean mapbool(char *p) return FALSE; if (!strcasecmp(p, "false")) return FALSE; + if (!strcasecmp(p, "no")) + return FALSE; if (!strcasecmp(p, "true")) return TRUE; + if (!strcasecmp(p, "yes")) + return TRUE; return atoi(p); } -- 2.40.0