summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-02-12 21:47:37 +0100
committerLennart Poettering <lennart@poettering.net>2013-02-13 00:56:13 +0100
commitb43d1d01eabe2cbbf393e8f56b76e182c6069c4c (patch)
tree2c15db7971c0514f3e3f741b44fbe42bd7802fbd /src/shared/util.c
parent641906e9366891e0ad3e6e38b7396a427678c4cf (diff)
util: introduce strcaseeq/strncaseeq
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 8dceb82051..aa0532a2be 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -218,9 +218,9 @@ void close_many(const int fds[], unsigned n_fd) {
int parse_boolean(const char *v) {
assert(v);
- if (streq(v, "1") || v[0] == 'y' || v[0] == 'Y' || v[0] == 't' || v[0] == 'T' || !strcasecmp(v, "on"))
+ if (streq(v, "1") || v[0] == 'y' || v[0] == 'Y' || v[0] == 't' || v[0] == 'T' || strcaseeq(v, "on"))
return 1;
- else if (streq(v, "0") || v[0] == 'n' || v[0] == 'N' || v[0] == 'f' || v[0] == 'F' || !strcasecmp(v, "off"))
+ else if (streq(v, "0") || v[0] == 'n' || v[0] == 'N' || v[0] == 'f' || v[0] == 'F' || strcaseeq(v, "off"))
return 0;
return -EINVAL;