From d25fb8baf57101370648067cc7bfe253ae7cd7e6 Mon Sep 17 00:00:00 2001
From: Frederic Culot <calcurse@culot.org>
Date: Thu, 7 Sep 2006 14:08:55 +0000
Subject: bugfix: the repeated end date can no longer be older then the item
 start time. Thanks Chris for reporting that bug

---
 src/recur.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

(limited to 'src')

diff --git a/src/recur.c b/src/recur.c
index 840ae2d..611504b 100755
--- a/src/recur.c
+++ b/src/recur.c
@@ -1,4 +1,4 @@
-/*	$calcurse: recur.c,v 1.7 2006/08/24 20:12:21 culot Exp $	*/
+/*	$calcurse: recur.c,v 1.8 2006/09/07 14:08:55 culot Exp $	*/
 
 /*
  * Calcurse - text-based organizer
@@ -515,6 +515,8 @@ void recur_repeat_item(int sel_year, int sel_month, int sel_day,
 	_("Possible formats are [mm/dd/yyyy] or '0' for an endless repetetition");
 	char *wrong_type_1 = _("This item is already a repeated one.");
 	char *wrong_type_2 = _("Press [ENTER] to continue.");
+	char *mesg_older   = 
+	_("Sorry, the date you entered is older than the item start time.");
 	int type = 0, freq = 0;
 	struct day_item_s *p; 
 	struct recur_apoint_s *ra;
@@ -570,7 +572,14 @@ void recur_repeat_item(int sel_year, int sel_month, int sel_day,
 					sscanf(user_input, "%d / %d / %d", 
 						&month, &day, &year);	
 					until = date2sec(year, month, day, 0, 0);
-					date_entered = 1;
+					if (until < p->start) {
+						status_mesg(mesg_older,
+							wrong_type_2);
+						wgetch(swin);
+						date_entered = 0;
+					} else {
+						date_entered = 1;
+					}
 				} else {
 					status_mesg(mesg_wrong_1, mesg_wrong_2);
 					date_entered = 0;
-- 
cgit v1.2.3-70-g09d2