aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/cal-util/cal-util.c11
2 files changed, 14 insertions, 4 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 88ad3dff4d..d0e8b004dd 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+2001-11-02 Federico Mena Quintero <federico@ximian.com>
+
+ * cal-util/cal-util.c (compute_alarm_range): Short-circuit the
+ calculation of the repeat time if there are zero repetitions.
+ (compute_alarm_range): I'm a moron. De-reference alarm_start when
+ subtracting stuff from it! Fixes bug #14209.
+
2001-10-31 Ettore Perazzoli <ettore@ximian.com>
* gui/dialogs/Makefile.am: Added rules to generate
diff --git a/calendar/cal-util/cal-util.c b/calendar/cal-util/cal-util.c
index 5cc6bbfc77..a30329c638 100644
--- a/calendar/cal-util/cal-util.c
+++ b/calendar/cal-util/cal-util.c
@@ -142,9 +142,12 @@ compute_alarm_range (CalComponent *comp, GList *alarm_uids, time_t start, time_t
dur = &trigger.u.rel_duration;
dur_time = icaldurationtype_as_int (*dur);
- repeat_time = MAX (repeat_time,
- (repeat.repetitions
- * icaldurationtype_as_int (repeat.duration)));
+ if (repeat.repetitions != 0) {
+ int rdur;
+
+ rdur = repeat.repetitions * icaldurationtype_as_int (repeat.duration);
+ repeat_time = MAX (repeat_time, rdur);
+ }
if (dur->is_neg)
/* If the duration is negative then dur_time
@@ -162,7 +165,7 @@ compute_alarm_range (CalComponent *comp, GList *alarm_uids, time_t start, time_t
}
}
- alarm_start -= repeat_time;
+ *alarm_start -= repeat_time;
g_assert (*alarm_start <= *alarm_end);
}