chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: introduce strcaseeq/strncaseeq
[elogind.git]
/
src
/
shared
/
util.c
diff --git
a/src/shared/util.c
b/src/shared/util.c
index 8dceb820516fe4ac83dc4b2f4afc3ad26e4ef0d8..aa0532a2be71e1f27888b4da94fe1240187c7069 100644
(file)
--- 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);
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;
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;
return 0;
return -EINVAL;