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-12-06 09:00:22 -0800
commit77e259080fdd3effda23255e9f2fe95890880e76 (patch)
tree58d941fe812047915d21c4c53cfb3416f3f645e0
parentf6ae4fde51f975d50f04c6650fcce77098d6d0a9 (diff)
downloadsubsurface-77e259080fdd3effda23255e9f2fe95890880e76.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;
}