aboutsummaryrefslogtreecommitdiffstats
path: root/src/calcurse.c
diff options
context:
space:
mode:
authorLars Henriksen <LarsHenriksen@get2net.dk>2018-09-05 08:46:16 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2018-10-21 20:02:57 +0200
commit4b192c07733eac9be3404304cae3cf0c17374cec (patch)
treecffa780149e579b5eec8b2dc5ece2b4fcae9cbfa /src/calcurse.c
parentff402d21abdf4c33aa2c6bd81bc0a4818f00edfc (diff)
downloadcalcurse-4b192c07733eac9be3404304cae3cf0c17374cec.tar.gz
calcurse-4b192c07733eac9be3404304cae3cf0c17374cec.zip
Error return code for io_reload_data()
The return code from new_data() and io_load_data() is explicitly defined as a bit mask. A file access error is recognised and reported back to the user. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/calcurse.c')
-rw-r--r--src/calcurse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/calcurse.c b/src/calcurse.c
index 31be357..16d979f 100644
--- a/src/calcurse.c
+++ b/src/calcurse.c
@@ -309,7 +309,9 @@ static inline void key_generic_reload(void)
int ret;
ret = io_reload_data();
- if (ret != IO_RELOAD_CANCEL && ret != IO_RELOAD_NOOP) {
+ if (ret == IO_RELOAD_LOAD ||
+ ret == IO_RELOAD_CTINUE ||
+ ret == IO_RELOAD_MERGE) {
ui_todo_load_items();
ui_todo_sel_reset();
do_storage(0);
@@ -331,6 +333,8 @@ static inline void key_generic_reload(void)
case IO_RELOAD_NOOP:
msg = _("Data were already loaded");
break;
+ case IO_RELOAD_ERROR:
+ EXIT(_("Cannot open data file"));
}
status_mesg(msg, "");
}