summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-10-31 19:29:41 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-31 16:40:17 -0700
commit0f90e68385ff49b1c1924566805a69422eb6efc8 (patch)
treec00a28c53fcdb08e7da0fc0a985bba346c142c74
parentf38ca97a78aa01afdd8ed3093fc104e6e0f101ce (diff)
downloadsubsurface-0f90e68385ff49b1c1924566805a69422eb6efc8.tar.gz
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 <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--file.c3
1 files changed, 3 insertions, 0 deletions
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;
}