From 7628a306ab454699429685b32e317080d58791e4 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Wed, 7 Dec 2022 06:23:24 -0600 Subject: [PATCH] 0.10.5 --- src/zippy/ziparchives.nim | 9 ++++++++- zippy.nimble | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/zippy/ziparchives.nim b/src/zippy/ziparchives.nim index f244cb8..bbe5e4c 100644 --- a/src/zippy/ziparchives.nim +++ b/src/zippy/ziparchives.nim @@ -254,7 +254,14 @@ proc openZipArchive*( # exe). This handles that by determining where the zip archive is from # the start of the file. let - socd = result.findStartOfCentralDirectory(eocd, numCentralDirectoryRecords) + socd = + try: + # Try to find the start relative to the end of the file, supporting + # zip archives being concatenated to the end. If this fails for any + # reason, fall back to the default behavior. + result.findStartOfCentralDirectory(eocd, numCentralDirectoryRecords) + except ZippyError: + centralDirectoryStart socdOffset = socd - centralDirectoryStart var pos = socdOffset + centralDirectoryStart diff --git a/zippy.nimble b/zippy.nimble index e4cc2e2..c9ed6b5 100644 --- a/zippy.nimble +++ b/zippy.nimble @@ -1,4 +1,4 @@ -version = "0.10.4" +version = "0.10.5" author = "Ryan Oldenburg" description = "Pure Nim implementation of deflate, zlib, gzip and zip." license = "MIT"