From ef0df587614fc98b35d882c793d515d6a7bbfcb2 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 26 Sep 2007 07:52:48 +0000 Subject: Fix rc_env_bool --- src/_usage.h | 2 +- src/librc-misc.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/_usage.h b/src/_usage.h index cff60df5..f75da52e 100644 --- a/src/_usage.h +++ b/src/_usage.h @@ -7,7 +7,7 @@ * Released under the GPLv2 */ -#define getoptstring_COMMON "Chq" +#define getoptstring_COMMON "Chqv" #define longopts_COMMON \ { "help", 0, NULL, 'h'}, \ diff --git a/src/librc-misc.c b/src/librc-misc.c index f2ecd165..ad144395 100644 --- a/src/librc-misc.c +++ b/src/librc-misc.c @@ -69,16 +69,16 @@ bool rc_env_bool (const char *var) return (false); } - if (strcasecmp (var, "true") == 0 || - strcasecmp (var, "y") == 0 || - strcasecmp (var, "yes") == 0 || - strcasecmp (var, "1") == 0) + if (strcasecmp (v, "true") == 0 || + strcasecmp (v, "y") == 0 || + strcasecmp (v, "yes") == 0 || + strcasecmp (v, "1") == 0) return (true); - if (strcasecmp (var, "false") != 0 && - strcasecmp (var, "n") != 0 && - strcasecmp (var, "no") != 0 && - strcasecmp (var, "0") != 0) + if (strcasecmp (v, "false") != 0 && + strcasecmp (v, "n") != 0 && + strcasecmp (v, "no") != 0 && + strcasecmp (v, "0") != 0) errno = EINVAL; return (false); -- cgit v1.2.3