From 0f90e68385ff49b1c1924566805a69422eb6efc8 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sat, 31 Oct 2015 19:29:41 +0200 Subject: Give proper error message when no dives on a zip We import a few logs that are archived in a zip file. E.g. divelogs.de import is a zip file named with .dld extension. In case the zip file is empty, we should return an error message that states that fact, not parse error. This will also end the input file parsing cleaning up the error message on the console. Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/file.c b/file.c index c4032c1f2..0263da457 100644 --- a/file.c +++ b/file.c @@ -105,6 +105,9 @@ int try_to_open_zip(const char *filename, struct memblock *mem) success++; } subsurface_zip_close(zip); + + if (!success) + return report_error(translate("gettextFromC", "No dives in the input file '%s'"), filename); } return success; } -- cgit v1.2.3-70-g09d2