diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-04-30 15:07:45 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-05-04 10:11:19 +0200 |
commit | ddd6a22a0fb034c763495fa1f3b6ebdd6a669e27 (patch) | |
tree | ac7bfb9eec91128813c0c9a54522f3983d411a36 /src/shared/calendarspec.c | |
parent | man: fix few spelling errors (diff) | |
download | systemd-ddd6a22a0fb034c763495fa1f3b6ebdd6a669e27.tar.xz systemd-ddd6a22a0fb034c763495fa1f3b6ebdd6a669e27.zip |
basic: add STRCASE_IN_SET() which is to STR_IN_SET() what strcaseeq() is to streq()
Diffstat (limited to '')
-rw-r--r-- | src/shared/calendarspec.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c index 217ab3fbaf..4103cf3ef0 100644 --- a/src/shared/calendarspec.c +++ b/src/shared/calendarspec.c @@ -17,6 +17,7 @@ #include "process-util.h" #include "sort-util.h" #include "string-util.h" +#include "strv.h" #include "time-util.h" #define BITS_WEEKDAYS 127 @@ -961,9 +962,10 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) { if (r < 0) return r; - } else if (strcaseeq(p, "annually") || - strcaseeq(p, "yearly") || - strcaseeq(p, "anually") /* backwards compatibility */ ) { + } else if (STRCASE_IN_SET(p, + "annually", + "yearly", + "anually") /* backwards compatibility */ ) { r = const_chain(1, &c->month); if (r < 0) @@ -1022,10 +1024,11 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) { if (r < 0) return r; - } else if (strcaseeq(p, "biannually") || - strcaseeq(p, "bi-annually") || - strcaseeq(p, "semiannually") || - strcaseeq(p, "semi-annually")) { + } else if (STRCASE_IN_SET(p, + "biannually", + "bi-annually", + "semiannually", + "semi-annually")) { r = const_chain(1, &c->month); if (r < 0) |