aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-11-03 06:08:50 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-11-03 06:08:50 +0800
commitdc354f10e83c1a1aca64454ef45059af4b69279e (patch)
tree15cf029f95cdd4575cb48a034983364d34ce7f98 /calendar
parentda698af7bf49fa3cb4036046a902a0d31010b0aa (diff)
downloadgsoc2013-evolution-dc354f10e83c1a1aca64454ef45059af4b69279e.tar.gz
gsoc2013-evolution-dc354f10e83c1a1aca64454ef45059af4b69279e.tar.zst
gsoc2013-evolution-dc354f10e83c1a1aca64454ef45059af4b69279e.zip
Short-circuit the calculation of the repeat time if there are zero
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. svn path=/trunk/; revision=14572
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);
}
-11-271-2/+2 * Mark Edwards <mark@antsclimbtree.com> described to me a way to getarved2004-11-223-4/+20 * Register myself as maintainer. I still use it.arved2004-11-222-9/+6 * Fix with perl 5.8.4+:arved2004-11-082-0/+12 * Fix typo.kuriyama2004-07-091-1/+1 * Upgrade to 2.661.kuriyama2004-01-172-3/+2 * o Though this port does not support packaging, but fixed pkg-plistkuriyama2004-01-032-4/+9 * Update to MovableType 2.65, which contains an important XMLRPC securityroam2003-12-313-6/+13 * o Fix schemas directory in mt-load.cgi to fit our installation.kuriyama2003-12-132-0/+4 * It seems that MASTER_SITES release rerolled distfile.leeym2003-12-041-1/+1 * Submitted by: ijliaofoxfair2003-11-212-5/+5 * KATO mega patchedwin2003-09-271-3/+3 * PR:foxfair2003-09-031-0/+2 * PR: 54382foxfair2003-07-141-4/+10