From da370af54b419132d5f1e990f79b06ad8ebe66c0 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 9 Mar 2020 11:34:21 +0100 Subject: Windows: Update libzip to 1.6.1 --- src/Common/libzip/zip_source_win32handle.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/Common/libzip/zip_source_win32handle.c') diff --git a/src/Common/libzip/zip_source_win32handle.c b/src/Common/libzip/zip_source_win32handle.c index 3a2f52e1..8746cdd1 100644 --- a/src/Common/libzip/zip_source_win32handle.c +++ b/src/Common/libzip/zip_source_win32handle.c @@ -1,6 +1,6 @@ /* zip_source_win32file.c -- create data source from HANDLE (Win32) - Copyright (C) 1999-2018 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2019 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. The authors can be contacted at @@ -127,6 +127,8 @@ _zip_source_win32_handle_or_name(const void *fname, HANDLE h, zip_uint64_t start ctx->supports = ZIP_SOURCE_SUPPORTS_SEEKABLE; } + ctx->supports |= ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_ACCEPT_EMPTY); + if ((zs = zip_source_function_create(_win32_read_file, ctx, error)) == NULL) { free(ctx->fname); free(ctx); @@ -148,6 +150,9 @@ _win32_read_file(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd buf = (char *)data; switch (cmd) { + case ZIP_SOURCE_ACCEPT_EMPTY: + return 0; + case ZIP_SOURCE_BEGIN_WRITE: if (ctx->fname == NULL) { zip_error_set(&ctx->error, ZIP_ER_OPNOTSUPP, 0); @@ -261,7 +266,7 @@ _win32_read_file(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd switch (args->whence) { case SEEK_SET: - new_current = args->offset; + new_current = args->offset + ctx->start; break; case SEEK_END: -- cgit v1.2.3