Fix rc_env_bool
This commit is contained in:
parent
e24d808fc5
commit
ef0df58761
@ -7,7 +7,7 @@
|
|||||||
* Released under the GPLv2
|
* Released under the GPLv2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define getoptstring_COMMON "Chq"
|
#define getoptstring_COMMON "Chqv"
|
||||||
|
|
||||||
#define longopts_COMMON \
|
#define longopts_COMMON \
|
||||||
{ "help", 0, NULL, 'h'}, \
|
{ "help", 0, NULL, 'h'}, \
|
||||||
|
@ -69,16 +69,16 @@ bool rc_env_bool (const char *var)
|
|||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcasecmp (var, "true") == 0 ||
|
if (strcasecmp (v, "true") == 0 ||
|
||||||
strcasecmp (var, "y") == 0 ||
|
strcasecmp (v, "y") == 0 ||
|
||||||
strcasecmp (var, "yes") == 0 ||
|
strcasecmp (v, "yes") == 0 ||
|
||||||
strcasecmp (var, "1") == 0)
|
strcasecmp (v, "1") == 0)
|
||||||
return (true);
|
return (true);
|
||||||
|
|
||||||
if (strcasecmp (var, "false") != 0 &&
|
if (strcasecmp (v, "false") != 0 &&
|
||||||
strcasecmp (var, "n") != 0 &&
|
strcasecmp (v, "n") != 0 &&
|
||||||
strcasecmp (var, "no") != 0 &&
|
strcasecmp (v, "no") != 0 &&
|
||||||
strcasecmp (var, "0") != 0)
|
strcasecmp (v, "0") != 0)
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
|
|
||||||
return (false);
|
return (false);
|
||||||
|
Loading…
Reference in New Issue
Block a user