From: Lennart Poettering Date: Tue, 19 Nov 2013 00:13:42 +0000 (+0100) Subject: calendar: support 'yearly' and 'annually' names the same way as cron X-Git-Tag: v209~1391 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=135168183ecb23f642b4f9fb9a50410e6735c628 calendar: support 'yearly' and 'annually' names the same way as cron --- diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c index 7979e2384..707515918 100644 --- a/src/shared/calendarspec.c +++ b/src/shared/calendarspec.c @@ -686,6 +686,23 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) { if (r < 0) goto fail; + } else if (strcaseeq(p, "anually") || strcaseeq(p, "yearly")) { + r = const_chain(1, &c->month); + if (r < 0) + goto fail; + r = const_chain(1, &c->day); + if (r < 0) + goto fail; + r = const_chain(0, &c->hour); + if (r < 0) + goto fail; + r = const_chain(0, &c->minute); + if (r < 0) + goto fail; + r = const_chain(0, &c->second); + if (r < 0) + goto fail; + } else if (strcaseeq(p, "weekly")) { c->weekdays_bits = 1;