mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 18:43:24 +00:00
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:
parent
f38ca97a78
commit
0f90e68385
1 changed files with 3 additions and 0 deletions
3
file.c
3
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue