From 97df01b534ac5616f39c1a1ffff8fc8e3e7927f9 Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Tue, 3 Nov 2020 19:28:19 +0100 Subject: Return failure if import skips any item Other items may have been imported succesfully. Adresses Github issue #323, last part. Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/args.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/args.c') diff --git a/src/args.c b/src/args.c index abcc70a..c66c724 100644 --- a/src/args.c +++ b/src/args.c @@ -428,7 +428,7 @@ int parse_args(int argc, char **argv) const char *cfile = NULL, *confdir = NULL; char *ifile = NULL; - int non_interactive = 1; + int ret, non_interactive = 1; int ch, cpid, type; regex_t reg; char buf[BUFSIZ]; @@ -963,10 +963,12 @@ int parse_args(int argc, char **argv) fmt_apt = fmt_rapt = fmt_ev = fmt_rev = NULL; fmt_todo = NULL; } - io_import_data(IO_IMPORT_ICAL, ifile, fmt_ev, fmt_rev, fmt_apt, - fmt_rapt, fmt_todo); + ret = io_import_data(IO_IMPORT_ICAL, ifile, fmt_ev, fmt_rev, + fmt_apt, fmt_rapt, fmt_todo); io_save_apts(path_apts); io_save_todo(path_todo); + if (!ret) + exit_calcurse(EXIT_FAILURE); } else if (export) { io_check_file(path_apts); io_check_file(path_todo); -- cgit v1.2.3-54-g00ecf