diff options
author | Lars Henriksen <LarsHenriksen@get2net.dk> | 2018-06-04 17:01:01 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2018-06-05 05:52:30 +0200 |
commit | 40eb6f809eb22770543fe5ec6c0fc1fc1c9297df (patch) | |
tree | d3703a2b36018bfd5367b07c1fb0e2bbaaa5a309 /src | |
parent | 500b0c080e53c40dc46bbc05e94575b32fa72499 (diff) | |
download | calcurse-40eb6f809eb22770543fe5ec6c0fc1fc1c9297df.tar.gz calcurse-40eb6f809eb22770543fe5ec6c0fc1fc1c9297df.zip |
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 <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/ui-day.c | 8 |
1 files 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); } |