aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/apoint.c2
-rw-r--r--src/args.c4
-rw-r--r--src/calcurse.c2
-rw-r--r--src/calcurse.h3
-rw-r--r--src/config.c2
-rw-r--r--src/custom.c2
-rw-r--r--src/day.c32
-rw-r--r--src/dmon.c2
-rw-r--r--src/event.c2
-rw-r--r--src/getstring.c2
-rw-r--r--src/help.c2
-rw-r--r--src/hooks.c2
-rw-r--r--src/htable.h2
-rw-r--r--src/ical.c10
-rw-r--r--src/io.c2
-rw-r--r--src/keys.c2
-rw-r--r--src/listbox.c2
-rw-r--r--src/llist.c2
-rw-r--r--src/llist.h2
-rw-r--r--src/llist_ts.h2
-rw-r--r--src/mem.c2
-rw-r--r--src/note.c2
-rw-r--r--src/notify.c2
-rw-r--r--src/pcal.c2
-rw-r--r--src/queue.c2
-rw-r--r--src/recur.c22
-rw-r--r--src/sha1.c2
-rw-r--r--src/sha1.h2
-rw-r--r--src/sigs.c2
-rw-r--r--src/strings.c2
-rw-r--r--src/todo.c2
-rw-r--r--src/ui-calendar.c13
-rw-r--r--src/ui-day.c2
-rw-r--r--src/ui-todo.c23
-rw-r--r--src/utf8.c2
-rw-r--r--src/utils.c2
-rw-r--r--src/vars.c2
-rw-r--r--src/vector.c2
-rw-r--r--src/vector.h2
-rw-r--r--src/wins.c2
40 files changed, 106 insertions, 67 deletions
diff --git a/src/apoint.c b/src/apoint.c
index d6e9bc1..e138e5e 100644
--- a/src/apoint.c
+++ b/src/apoint.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/args.c b/src/args.c
index a9d6df0..57cbe63 100644
--- a/src/args.c
+++ b/src/args.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -112,7 +112,7 @@ static void version_arg(void)
{
printf(_("calcurse %s -- text-based organizer\n"), VERSION);
putchar('\n');
- printf("%s\n", _("Copyright (c) 2004-2022 calcurse Development Team."));
+ printf("%s\n", _("Copyright (c) 2004-2023 calcurse Development Team."));
printf("%s\n", _("This is free software; see the source for copying conditions."));
}
diff --git a/src/calcurse.c b/src/calcurse.c
index 84d1a9b..c89d1dd 100644
--- a/src/calcurse.c
+++ b/src/calcurse.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/calcurse.h b/src/calcurse.h
index ee96bbe..8322416 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -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/config.c b/src/config.c
index 9e2e40e..4e0f7db 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/custom.c b/src/custom.c
index 13570c6..2cd385c 100644
--- a/src/custom.c
+++ b/src/custom.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/day.c b/src/day.c
index 7eb6693..78f4acf 100644
--- a/src/day.c
+++ b/src/day.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -198,7 +198,8 @@ 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) {
+ switch (day->type)
+ {
case APPT:
return day->item.apt->mesg;
case EVNT:
@@ -212,6 +213,15 @@ char *day_item_get_mesg(struct day_item *day)
}
}
+/* Get the display message of an item. */
+char *day_item_get_display_mesg(struct day_item *day)
+{
+ char *msg = day_item_get_mesg(day);
+ if (msg[0] == '\0')
+ return EMPTY_EVENT_DESC_DEFAULT;
+ return msg;
+}
+
/* Get the note attached to an item. */
char *day_item_get_note(struct day_item *day)
{
@@ -529,7 +539,7 @@ day_display_item(struct day_item *day, WINDOW *win, int incolor, int width,
if (width <= 0)
return;
- char *mesg = day_item_get_mesg(day);
+ char *mesg = day_item_get_display_mesg(day);
ch_recur = (day->type == RECUR_EVNT) ? '*' : ' ';
ch_note = day_item_get_note(day) ? '>' : ' ';
@@ -624,15 +634,19 @@ void day_popup_item(struct day_item *day)
asprintf(&notepath, "%s%s", path_notes, day_item_get_note(day));
fp = fopen(notepath, "r");
+ if (fp == NULL) {
+ item_in_popup(NULL, NULL, day_item_get_mesg(day), _("Event:"));
+ return;
+ }
note_read_contents(note, note_size, fp);
fclose(fp);
mem_free(notepath);
- asprintf(&msg, "%s\n\n%s\n%s", day_item_get_mesg(day), note_heading, note);
+ asprintf(&msg, "%s\n\n%s\n%s", day_item_get_display_mesg(day), note_heading, note);
item_in_popup(NULL, NULL, msg, _("Event:"));
mem_free(msg);
} else {
- item_in_popup(NULL, NULL, day_item_get_mesg(day), _("Event:"));
+ item_in_popup(NULL, NULL, day_item_get_display_mesg(day), _("Event:"));
}
} else if (day->type == APPT || day->type == RECUR_APPT) {
char a_st[100], a_end[100];
@@ -651,15 +665,19 @@ void day_popup_item(struct day_item *day)
asprintf(&notepath, "%s%s", path_notes, day_item_get_note(day));
fp = fopen(notepath, "r");
+ if (fp == NULL) {
+ item_in_popup(a_st, a_end, day_item_get_mesg(day), _("Appointment:"));
+ return;
+ }
note_read_contents(note, note_size, fp);
fclose(fp);
mem_free(notepath);
- asprintf(&msg, "%s\n\n%s\n%s", day_item_get_mesg(day), note_heading, note);
+ asprintf(&msg, "%s\n\n%s\n%s", day_item_get_display_mesg(day), note_heading, note);
item_in_popup(a_st, a_end, msg, _("Appointment:"));
mem_free(msg);
} else {
- item_in_popup(a_st, a_end, day_item_get_mesg(day), _("Appointment:"));
+ item_in_popup(a_st, a_end, day_item_get_display_mesg(day), _("Appointment:"));
}
} else {
EXIT(_("unknown item type"));
diff --git a/src/dmon.c b/src/dmon.c
index 807519a..11d3458 100644
--- a/src/dmon.c
+++ b/src/dmon.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/event.c b/src/event.c
index f3a6298..7c371e4 100644
--- a/src/event.c
+++ b/src/event.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/getstring.c b/src/getstring.c
index 3e2b4da..8ea5df5 100644
--- a/src/getstring.c
+++ b/src/getstring.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/help.c b/src/help.c
index bf28c5a..3f2c94f 100644
--- a/src/help.c
+++ b/src/help.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/hooks.c b/src/hooks.c
index 1812e0d..f649076 100644
--- a/src/hooks.c
+++ b/src/hooks.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/htable.h b/src/htable.h
index 981003f..92be6e2 100644
--- a/src/htable.h
+++ b/src/htable.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/ical.c b/src/ical.c
index 535bca8..4a7738e 100644
--- a/src/ical.c
+++ b/src/ical.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -520,6 +520,10 @@ ical_store_event(char *mesg, char *note, time_t day, time_t end,
struct event *ev;
struct recur_event *rev;
+ if (!mesg)
+ mesg = mem_strdup(_("(empty)"));
+ EXIT_IF(!mesg, _("ical_store_event: out of memory"));
+
/*
* Repeating event. The end day is ignored, and the event becomes
* one-day even if multi-day.
@@ -572,6 +576,10 @@ ical_store_apoint(char *mesg, char *note, time_t start, long dur,
struct recur_apoint *rapt;
time_t day;
+ if (!mesg)
+ mesg = mem_strdup(_("(empty)"));
+ EXIT_IF(!mesg, _("ical_store_event: out of memory"));
+
if (has_alarm)
state |= APOINT_NOTIFY;
if (rpt) {
diff --git a/src/io.c b/src/io.c
index e7ad094..d596aab 100644
--- a/src/io.c
+++ b/src/io.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/keys.c b/src/keys.c
index 607ef31..ae0375c 100644
--- a/src/keys.c
+++ b/src/keys.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/listbox.c b/src/listbox.c
index 7ac7a26..d86f540 100644
--- a/src/listbox.c
+++ b/src/listbox.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/llist.c b/src/llist.c
index 9d4cd9c..d31f004 100644
--- a/src/llist.c
+++ b/src/llist.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/llist.h b/src/llist.h
index 386dcf3..0dd15bf 100644
--- a/src/llist.h
+++ b/src/llist.h
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/llist_ts.h b/src/llist_ts.h
index 048077a..a4b6184 100644
--- a/src/llist_ts.h
+++ b/src/llist_ts.h
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/mem.c b/src/mem.c
index e19019f..ce3cf80 100644
--- a/src/mem.c
+++ b/src/mem.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/note.c b/src/note.c
index e9492e5..655ad89 100644
--- a/src/note.c
+++ b/src/note.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/notify.c b/src/notify.c
index a358bd5..6eda361 100644
--- a/src/notify.c
+++ b/src/notify.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/pcal.c b/src/pcal.c
index 808508b..435656a 100644
--- a/src/pcal.c
+++ b/src/pcal.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/queue.c b/src/queue.c
index e6fce02..41cb69b 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/recur.c b/src/recur.c
index 64172ef..12f76b8 100644
--- a/src/recur.c
+++ b/src/recur.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -1003,14 +1003,20 @@ static int find_occurrence(time_t start, long dur, struct rpt *rpt, llist_t *exc
if (rpt->until && t >= NEXTDAY(rpt->until))
return 0;
- /* Does it span the given day? */
- if (t + DUR(t) < day)
+ /* Does it span the given day?
+ *
+ * NOTE: An appointment ending at 00:00 is not considered to span the
+ * given day, unless the appointment is an appointment without
+ * specified end time, which is internally treated as appointment with
+ * duration 0.
+ */
+ if (t + DUR(t) >= day || (t == day && dur == 0)) {
+ if (occurrence)
+ *occurrence = t;
+ return 1;
+ } else {
return 0;
-
- if (occurrence)
- *occurrence = t;
-
- return 1;
+ }
}
#undef DUR
diff --git a/src/sha1.c b/src/sha1.c
index eff78a1..6ab63f8 100644
--- a/src/sha1.c
+++ b/src/sha1.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/sha1.h b/src/sha1.h
index e1ede67..25d60b9 100644
--- a/src/sha1.h
+++ b/src/sha1.h
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/sigs.c b/src/sigs.c
index dea671c..9320652 100644
--- a/src/sigs.c
+++ b/src/sigs.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/strings.c b/src/strings.c
index f05f78b..45c9310 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/todo.c b/src/todo.c
index 15b9353..9bd8f8a 100644
--- a/src/todo.c
+++ b/src/todo.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/ui-calendar.c b/src/ui-calendar.c
index f386d58..c1719d8 100644
--- a/src/ui-calendar.c
+++ b/src/ui-calendar.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -560,9 +560,8 @@ draw_weekly_view(struct scrollwin *sw, struct date *current_day)
if (j != WEEKINDAYS - 1
&& i != DAYSLICESNO - 1) {
WINS_CALENDAR_LOCK;
- mvwhline(sw->inner, OFFY + 2 + i,
- OFFX + 3 + 4 * j, ACS_S9,
- 2);
+ mvwaddstr(sw->inner, OFFY + 2 + i,
+ OFFX + 3 + 4 * j, "__");
WINS_CALENDAR_UNLOCK;
}
if (slices[i]) {
@@ -593,9 +592,9 @@ draw_weekly_view(struct scrollwin *sw, struct date *current_day)
/* Draw marks to indicate midday on the sides of the calendar. */
WINS_CALENDAR_LOCK;
custom_apply_attr(sw->inner, ATTR_HIGHEST);
- mvwhline(sw->inner, OFFY + 1 + DAYSLICESNO / 2, OFFX, ACS_S9, 1);
- mvwhline(sw->inner, OFFY + 1 + DAYSLICESNO / 2,
- OFFX + WCALWIDTH - 1, ACS_S9, 1);
+ mvwaddch(sw->inner, OFFY + 1 + DAYSLICESNO / 2, OFFX, '<');
+ mvwaddch(sw->inner, OFFY + 1 + DAYSLICESNO / 2,
+ OFFX + WCALWIDTH - 1, '>');
custom_remove_attr(sw->inner, ATTR_HIGHEST);
WINS_CALENDAR_UNLOCK;
diff --git a/src/ui-day.c b/src/ui-day.c
index 566ccd7..6a038fa 100644
--- a/src/ui-day.c
+++ b/src/ui-day.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/ui-todo.c b/src/ui-todo.c
index c715250..46933b3 100644
--- a/src/ui-todo.c
+++ b/src/ui-todo.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -207,14 +207,16 @@ void ui_todo_draw(int n, WINDOW *win, int y, int hilt, void *cb_data)
if (hilt)
custom_apply_attr(win, ATTR_HIGHEST);
- if (utf8_strwidth(todo->mesg) < width) {
- mesg = todo->mesg;
- } else {
+ mesg = todo->mesg;
+ if (mesg[0] == '\0')
+ mesg = EMPTY_EVENT_DESC_DEFAULT;
+
+ if (utf8_strwidth(mesg) >= width) {
width -= 3;
- for (j = 0; todo->mesg[j] && width > 0; j++) {
- if (!UTF8_ISCONT(todo->mesg[j]))
- width -= utf8_width(&todo->mesg[j]);
- buf[j] = todo->mesg[j];
+ for (j = 0; mesg[j] && width > 0; j++) {
+ if (!UTF8_ISCONT(mesg[j]))
+ width -= utf8_width(&mesg[j]);
+ buf[j] = mesg[j];
}
if (j) {
buf[j - 1] = '.';
@@ -325,6 +327,11 @@ void ui_todo_popup_item(void)
asprintf(&notepath, "%s%s", path_notes, item->note);
fp = fopen(notepath, "r");
+ if (fp == NULL) {
+ item_in_popup(NULL, NULL, item->mesg, _("TODO:"));
+ return;
+ }
+
note_read_contents(note, note_size, fp);
fclose(fp);
mem_free(notepath);
diff --git a/src/utf8.c b/src/utf8.c
index 78a25c2..997a4fa 100644
--- a/src/utf8.c
+++ b/src/utf8.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/utils.c b/src/utils.c
index 2640163..2d30bfc 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/vars.c b/src/vars.c
index c652dcc..97a129a 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/vector.c b/src/vector.c
index 8ab57b0..796ef8e 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/vector.h b/src/vector.h
index 9610924..7648df2 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/wins.c b/src/wins.c
index 3c80683..46ac98e 100644
--- a/src/wins.c
+++ b/src/wins.c
@@ -1,7 +1,7 @@
/*
* Calcurse - text-based organizer
*
- * Copyright (c) 2004-2022 calcurse Development Team <misc@calcurse.org>
+ * Copyright (c) 2004-2023 calcurse Development Team <misc@calcurse.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without