summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Culot <calcurse@culot.org>2007-05-06 13:33:06 +0000
committerFrederic Culot <calcurse@culot.org>2007-05-06 13:33:06 +0000
commitbfecd760b8a428eecd5978057253d3e783f84e62 (patch)
tree14a4ce2343a44471f9325c426b580cca9433c17c
parentd89344683c6ece0f64f9160c72cbfa5ec2412bd8 (diff)
downloadcalcurse-bfecd760b8a428eecd5978057253d3e783f84e62.tar.gz
calcurse-bfecd760b8a428eecd5978057253d3e783f84e62.zip
bugfix: item ending time is now assigned to correct day in day_edit_item()
-rwxr-xr-xsrc/day.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/day.c b/src/day.c
index e4c1ebd..4912300 100755
--- a/src/day.c
+++ b/src/day.c
@@ -1,4 +1,4 @@
-/* $calcurse: day.c,v 1.21 2007/04/04 19:38:18 culot Exp $ */
+/* $calcurse: day.c,v 1.22 2007/05/06 13:33:06 culot Exp $ */
/*
* Calcurse - text-based organizer
@@ -502,15 +502,11 @@ day_edit_item(int year, int month, int day, int item_num)
p->start + p->appt_dur);
sscanf(timestr, "%u:%u", &hr, &mn);
free(timestr);
- newtime = update_time_in_date(
- p->start + p->appt_dur, hr, mn);
- if (newtime > p->start) {
- p->appt_dur = newtime - p->start;
- valid_date = 1;
- } else {
- status_mesg(error_msg, enter_str);
- wgetch(swin);
- }
+ newtime = update_time_in_date(p->start, hr, mn);
+ p->appt_dur = (newtime > p->start) ?
+ newtime - p->start :
+ DAYINSEC + newtime - p->start;
+ valid_date = 1;
}
break;
case DESC: