diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-10-31 19:29:41 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-31 16:40:17 -0700 |
commit | 0f90e68385ff49b1c1924566805a69422eb6efc8 (patch) | |
tree | c00a28c53fcdb08e7da0fc0a985bba346c142c74 | |
parent | f38ca97a78aa01afdd8ed3093fc104e6e0f101ce (diff) | |
download | subsurface-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.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; } |