9fc0f6
From 9e4b36ca509cdcb39afaa9fc7a0f1901b8855647 Mon Sep 17 00:00:00 2001
9fc0f6
From: Lennart Poettering <lennart@poettering.net>
9fc0f6
Date: Tue, 19 Nov 2013 01:13:42 +0100
9fc0f6
Subject: [PATCH] calendar: support 'yearly' and 'annually' names the same way
9fc0f6
 as cron
9fc0f6
9fc0f6
---
9fc0f6
 src/shared/calendarspec.c | 17 +++++++++++++++++
9fc0f6
 1 file changed, 17 insertions(+)
9fc0f6
9fc0f6
diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c
9fc0f6
index 7979e23..7075159 100644
9fc0f6
--- a/src/shared/calendarspec.c
9fc0f6
+++ b/src/shared/calendarspec.c
9fc0f6
@@ -686,6 +686,23 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
9fc0f6
                 if (r < 0)
9fc0f6
                         goto fail;
9fc0f6
 
9fc0f6
+        } else if (strcaseeq(p, "anually") || strcaseeq(p, "yearly")) {
9fc0f6
+                r = const_chain(1, &c->month);
9fc0f6
+                if (r < 0)
9fc0f6
+                        goto fail;
9fc0f6
+                r = const_chain(1, &c->day);
9fc0f6
+                if (r < 0)
9fc0f6
+                        goto fail;
9fc0f6
+                r = const_chain(0, &c->hour);
9fc0f6
+                if (r < 0)
9fc0f6
+                        goto fail;
9fc0f6
+                r = const_chain(0, &c->minute);
9fc0f6
+                if (r < 0)
9fc0f6
+                        goto fail;
9fc0f6
+                r = const_chain(0, &c->second);
9fc0f6
+                if (r < 0)
9fc0f6
+                        goto fail;
9fc0f6
+
9fc0f6
         } else if (strcaseeq(p, "weekly")) {
9fc0f6
 
9fc0f6
                 c->weekdays_bits = 1;