diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-12-16 02:22:34 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2012-12-16 02:27:39 +0100 |
commit | 574306ff85de15f3ff8423ad08ec4f49bcba15b7 (patch) | |
tree | 975bfee697cb837ffe31e4e19d0428187b95846d /src | |
parent | 82942938be77f407d9bb67b81160e0160e9130e3 (diff) | |
download | calcurse-574306ff85de15f3ff8423ad08ec4f49bcba15b7.zip |
do_storage(): Unset highlighted item if list is empty
Check if the appointment panel contains any items and unset the
highlight counter if it doesn't. Not doing this resulted in core dumps
if the edit command was invoked after switching to a day without any
appointments/events.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/calcurse.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/calcurse.c b/src/calcurse.c index 85a7941..43189b0 100644 --- a/src/calcurse.c +++ b/src/calcurse.c @@ -52,8 +52,12 @@ static struct day_items_nb do_storage(int day_changed) struct day_items_nb inday = *day_process_storage(calendar_get_slctd_day(), day_changed, &inday); - if (day_changed) - apoint_hilt_set(1); + if (day_changed) { + if ((inday.nb_events + inday.nb_apoints) > 0) + apoint_hilt_set(1); + else + apoint_hilt_set(0); + } return inday; } |