aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan van der Steege <jonathan@jonakeys.nl>2022-06-21 22:15:38 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2022-12-25 15:13:52 -0500
commit7b350ac58f34c81d01f5cd6b0b36f6ec5c93c68e (patch)
tree5e65d5abde004b09213b000f8683053d11e57145 /src
parent77ffe5d62783ee722d62460ade501ff8a38eb45e (diff)
downloadcalcurse-7b350ac58f34c81d01f5cd6b0b36f6ec5c93c68e.tar.gz
calcurse-7b350ac58f34c81d01f5cd6b0b36f6ec5c93c68e.zip
Add text for displaying empty event description
Signed-off-by: Jonathan van der Steege <jonathan@jonakeys.nl> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src')
-rw-r--r--src/calcurse.h1
-rw-r--r--src/day.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/src/calcurse.h b/src/calcurse.h
index ee96bbe..c6dbe64 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -307,6 +307,7 @@ struct conf {
};
#define EMPTY_DAY_DEFAULT "--"
+#define EMPTY_EVENT_DESC_DEFAULT _("(empty description)")
/* Daemon-related configuration. */
struct dmon_conf {
diff --git a/src/day.c b/src/day.c
index 7eb6693..a6f338b 100644
--- a/src/day.c
+++ b/src/day.c
@@ -198,11 +198,16 @@ static void day_add_item(int type, time_t start, time_t order, union aptev_ptr i
/* Get the message of an item. */
char *day_item_get_mesg(struct day_item *day)
{
- switch (day->type) {
+ char *message;
+ switch (day->type)
+ {
case APPT:
return day->item.apt->mesg;
case EVNT:
- return day->item.ev->mesg;
+ message = day->item.ev->mesg;
+ if (*message == '\0')
+ return EMPTY_EVENT_DESC_DEFAULT;
+ return message;
case RECUR_APPT:
return day->item.rapt->mesg;
case RECUR_EVNT: