From 00a258cec7bbecf10e04fef7ed4781cd750ba1d8 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Fri, 13 Dec 2013 16:06:19 +0000 Subject: Fix ExtractEntryToFile. We would always write uncompressed data at offset 0 instead of the current filedescriptor offset. Also adds a unit-test & a clarifying comment on the API. Change-Id: If44757e96dde504ce63d81b4dec7115fc6f6d5fb --- include/ziparchive/zip_archive.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/ziparchive/zip_archive.h') diff --git a/include/ziparchive/zip_archive.h b/include/ziparchive/zip_archive.h index ac3d79288..18774948f 100644 --- a/include/ziparchive/zip_archive.h +++ b/include/ziparchive/zip_archive.h @@ -152,7 +152,10 @@ int32_t StartIteration(ZipArchiveHandle handle, void** cookie_ptr, int32_t Next(void* cookie, ZipEntry* data, ZipEntryName *name); /* - * Uncompress and write an entry to a file descriptor. + * Uncompress and write an entry to an open file identified by |fd|. + * |entry->uncompressed_length| bytes will be written to the file at + * its current offset, and the file will be truncated at the end of + * the uncompressed data. * * Returns 0 on success and negative values on failure. */ -- cgit v1.2.3