chiark / gitweb /
calendar: support 'yearly' and 'annually' names the same way as cron
authorLennart Poettering <lennart@poettering.net>
Tue, 19 Nov 2013 00:13:42 +0000 (01:13 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 20 Nov 2013 18:36:14 +0000 (19:36 +0100)
src/shared/calendarspec.c

index 7979e2384f53014e105d173519c60acb9a3ac6a9..7075159183152d191b5430fd43cfc5b2a56e3b18 100644 (file)
@@ -686,6 +686,23 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
                 if (r < 0)
                         goto fail;
 
                 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;
         } else if (strcaseeq(p, "weekly")) {
 
                 c->weekdays_bits = 1;