From 40eb6f809eb22770543fe5ec6c0fc1fc1c9297df Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Mon, 4 Jun 2018 17:01:01 +0200 Subject: Fix appointment becoming event You try to enter an appointment, but enter an invalid start time (by mistake). Calcurse rejects the input. You enter the correct start time and calcurse asks for the description, not the end time, i.e. you get an event. The check for an event must only be performed on valid input. Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/ui-day.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui-day.c b/src/ui-day.c index 53cb2f1..ab1f80b 100644 --- a/src/ui-day.c +++ b/src/ui-day.c @@ -534,11 +534,11 @@ void ui_day_item_add(void) is_appointment = 0; break; } - ret = parse_datetime(item_time, &start); - if (!(ret & PARSE_DATETIME_HAS_TIME)) - is_appointment = 0; - if (ret) + if ((ret = parse_datetime(item_time, &start))) { + if (!(ret & PARSE_DATETIME_HAS_TIME)) + is_appointment = 0; break; + } status_mesg(format_message_1, enter_str); keys_wait_for_any_key(win[KEY].p); } -- cgit v1.2.3-70-g09d2