chiark / gitweb /
calendar: new case 'minutely'
[elogind.git] / src / shared / calendarspec.c
index 69b742723295c5df91c03464fd70593d6bd97612..da920b6dd919f51acf0cdfab87dc16ca2de9641e 100644 (file)
@@ -35,7 +35,9 @@ static void free_chain(CalendarComponent *c) {
 }
 
 void calendar_spec_free(CalendarSpec *c) {
-        assert(c);
+
+        if (!c)
+                return;
 
         free_chain(c->year);
         free_chain(c->month);
@@ -653,7 +655,12 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
         if (!c)
                 return -ENOMEM;
 
-        if (strcaseeq(p, "hourly")) {
+        if (strcaseeq(p, "minutely")) {
+                r = const_chain(0, &c->second);
+                if (r < 0)
+                        goto fail;
+
+        } else if (strcaseeq(p, "hourly")) {
                 r = const_chain(0, &c->minute);
                 if (r < 0)
                         goto fail;
@@ -686,7 +693,8 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
                 if (r < 0)
                         goto fail;
 
-        } else if (strcaseeq(p, "anually") || strcaseeq(p, "yearly")) {
+        } else if (strcaseeq(p, "annually") || strcaseeq(p, "yearly")
+                   || strcaseeq(p, "anually") /* backwards compatibility */ ) {
                 r = const_chain(1, &c->month);
                 if (r < 0)
                         goto fail;