diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-10-14 01:28:14 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-10-14 01:28:14 +0100 |
| commit | 2abb944d5a1c000911de5aafa6079d10b5600db9 (patch) | |
| tree | 38a67ebcb6c5b93e317af67b221cd960f5b98a25 /src/lib/internet.cc | |
| parent | 5302f2cda0afd16d714ab898549c7cd278196473 (diff) | |
Try to fix crash when zip_open_from_source returns an error.
Diffstat (limited to 'src/lib/internet.cc')
| -rw-r--r-- | src/lib/internet.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/internet.cc b/src/lib/internet.cc index 662a82443..d6fb02a17 100644 --- a/src/lib/internet.cc +++ b/src/lib/internet.cc @@ -119,9 +119,10 @@ get_from_zip_url (string url, string file, bool pasv, function<void (boost::file return optional<string> (_("Could not open downloaded ZIP file")); } - zip_t* zip = zip_open_from_source (zip_source, 0, 0); + zip_error_t error; + zip_t* zip = zip_open_from_source (zip_source, ZIP_RDONLY, &error); if (!zip) { - return optional<string> (_("Could not open downloaded ZIP file")); + return String::compose (_("Could not open downloaded ZIP file (%1)"), error.str ? error.str : ""); } #else |
