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>
This commit is contained in:
Miika Turkia 2015-10-31 19:29:41 +02:00 committed by Dirk Hohndel
parent f38ca97a78
commit 0f90e68385

3
file.c
View file

@ -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;
}