Imported Upstream version 1.9.1 upstream/1.9.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 1 Sep 2022 01:34:10 +0000 (10:34 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 1 Sep 2022 01:34:10 +0000 (10:34 +0900)
150 files changed:
CMakeLists.txt
LICENSE
NEWS.md
README.md
lib/compat.h
lib/zip.h
lib/zip_add.c
lib/zip_add_dir.c
lib/zip_add_entry.c
lib/zip_algorithm_bzip2.c
lib/zip_algorithm_deflate.c
lib/zip_algorithm_xz.c
lib/zip_algorithm_zstd.c
lib/zip_buffer.c
lib/zip_close.c
lib/zip_crypto.h
lib/zip_crypto_commoncrypto.c
lib/zip_crypto_commoncrypto.h
lib/zip_crypto_gnutls.c
lib/zip_crypto_gnutls.h
lib/zip_crypto_mbedtls.c
lib/zip_crypto_mbedtls.h
lib/zip_crypto_openssl.c
lib/zip_crypto_openssl.h
lib/zip_crypto_win.c
lib/zip_crypto_win.h
lib/zip_delete.c
lib/zip_dir_add.c
lib/zip_dirent.c
lib/zip_discard.c
lib/zip_entry.c
lib/zip_error.c
lib/zip_error_clear.c
lib/zip_error_get.c
lib/zip_error_get_sys_type.c
lib/zip_error_strerror.c
lib/zip_error_to_str.c
lib/zip_extra_field.c
lib/zip_extra_field_api.c
lib/zip_fclose.c
lib/zip_fdopen.c
lib/zip_file_add.c
lib/zip_file_error_clear.c
lib/zip_file_error_get.c
lib/zip_file_get_comment.c
lib/zip_file_get_external_attributes.c
lib/zip_file_get_offset.c
lib/zip_file_rename.c
lib/zip_file_replace.c
lib/zip_file_set_comment.c
lib/zip_file_set_encryption.c
lib/zip_file_set_external_attributes.c
lib/zip_file_set_mtime.c
lib/zip_file_strerror.c
lib/zip_fopen.c
lib/zip_fopen_encrypted.c
lib/zip_fopen_index.c
lib/zip_fopen_index_encrypted.c
lib/zip_fread.c
lib/zip_fseek.c
lib/zip_ftell.c
lib/zip_get_archive_comment.c
lib/zip_get_archive_flag.c
lib/zip_get_encryption_implementation.c
lib/zip_get_file_comment.c
lib/zip_get_name.c
lib/zip_get_num_entries.c
lib/zip_get_num_files.c
lib/zip_hash.c
lib/zip_io_util.c
lib/zip_libzip_version.c
lib/zip_memdup.c
lib/zip_name_locate.c
lib/zip_new.c
lib/zip_open.c
lib/zip_pkware.c
lib/zip_progress.c
lib/zip_random_unix.c
lib/zip_random_uwp.c
lib/zip_random_win32.c
lib/zip_rename.c
lib/zip_replace.c
lib/zip_set_archive_comment.c
lib/zip_set_archive_flag.c
lib/zip_set_default_password.c
lib/zip_set_file_comment.c
lib/zip_set_file_compression.c
lib/zip_set_name.c
lib/zip_source_accept_empty.c
lib/zip_source_begin_write.c
lib/zip_source_begin_write_cloning.c
lib/zip_source_buffer.c
lib/zip_source_call.c
lib/zip_source_close.c
lib/zip_source_commit_write.c
lib/zip_source_compress.c
lib/zip_source_crc.c
lib/zip_source_error.c
lib/zip_source_file.h
lib/zip_source_file_common.c
lib/zip_source_file_stdio.c
lib/zip_source_file_stdio.h
lib/zip_source_file_stdio_named.c
lib/zip_source_file_win32.c
lib/zip_source_file_win32.h
lib/zip_source_file_win32_ansi.c
lib/zip_source_file_win32_named.c
lib/zip_source_file_win32_utf16.c
lib/zip_source_file_win32_utf8.c
lib/zip_source_free.c
lib/zip_source_function.c
lib/zip_source_get_file_attributes.c
lib/zip_source_is_deleted.c
lib/zip_source_layered.c
lib/zip_source_open.c
lib/zip_source_pkware_decode.c
lib/zip_source_pkware_encode.c
lib/zip_source_read.c
lib/zip_source_remove.c
lib/zip_source_rollback_write.c
lib/zip_source_seek.c
lib/zip_source_seek_write.c
lib/zip_source_stat.c
lib/zip_source_supports.c
lib/zip_source_tell.c
lib/zip_source_tell_write.c
lib/zip_source_window.c
lib/zip_source_winzip_aes_decode.c
lib/zip_source_winzip_aes_encode.c
lib/zip_source_write.c
lib/zip_source_zip.c
lib/zip_source_zip_new.c
lib/zip_stat.c
lib/zip_stat_index.c
lib/zip_stat_init.c
lib/zip_strerror.c
lib/zip_string.c
lib/zip_unchange.c
lib/zip_unchange_all.c
lib/zip_unchange_archive.c
lib/zip_unchange_data.c
lib/zip_utf-8.c
lib/zip_winzip_aes.c
lib/zipint.h
man/links
regress/NiHTest.pm
regress/extra_field_align.test
regress/open_file_count.test
regress/open_incons.test
regress/ziptool_regress.c

index 1363430..3ded409 100644 (file)
@@ -6,7 +6,7 @@ if (${CMAKE_VERSION} VERSION_LESS "3.17.0")
 endif()
 
 project(libzip
-  VERSION 1.9.0
+  VERSION 1.9.1
   LANGUAGES C)
 
 option(ENABLE_COMMONCRYPTO "Enable use of CommonCrypto" ON)
diff --git a/LICENSE b/LICENSE
index 573d5d9..fa70609 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
 Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner
 
-The authors can be contacted at <libzip@nih.at>
+The authors can be contacted at <info@libzip.org>
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
diff --git a/NEWS.md b/NEWS.md
index d8e1850..78d663c 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,8 @@
+1.9.1 [2022-06-28]
+===================
+
+* Fix `zip_file_is_seekable()`.
+
 1.9.0 [2022-06-13]
 ==================
 
index c8cffd5..3c2e31c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -32,7 +32,7 @@ subscribe to it by sending a mail with the subject "subscribe
 libzip-discuss" to minimalist at nih.at. List mail should be sent
 to libzip-discuss at nih.at. Use this for bug reports or questions.
 
-If you want to reach the authors in private, use <libzip@nih.at>.
+If you want to reach the authors in private, use <info@libzip.org>.
 
 [![Github Actions Build Status](https://github.com/nih-at/libzip/workflows/build/badge.svg)](https://github.com/nih-at/libzip/actions?query=workflow%3Abuild)
 [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/f1bqqt9djvf22f5g?svg=true)](https://ci.appveyor.com/project/nih-at/libzip)
index 47c28fd..49425f1 100644 (file)
@@ -6,7 +6,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index c211ed1..283607a 100644 (file)
--- a/lib/zip.h
+++ b/lib/zip.h
@@ -6,7 +6,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
@@ -242,6 +242,8 @@ typedef enum zip_source_cmd zip_source_cmd_t;
 
 #define ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd) (((zip_int64_t)1) << (cmd))
 
+#define ZIP_SOURCE_CHECK_SUPPORTED(supported, cmd)  (((supported) & ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd)) != 0)
+
 /* clang-format off */
 
 #define ZIP_SOURCE_SUPPORTS_READABLE   (ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_OPEN) \
index dd6dcbc..9770139 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 41de94b..c31fea3 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 6f3c162..bf12dd5 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index ebc68d9..c79cb8a 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 8707eec..03250ef 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index f0c2fd3..d8f4266 100644 (file)
@@ -4,7 +4,7 @@
   Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index a7e2d67..7a08fbb 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2020-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 4e5783e..a353ce0 100644 (file)
@@ -3,7 +3,7 @@
  Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
  This file is part of libzip, a library to manipulate ZIP archives.
- The authors can be contacted at <libzip@nih.at>
+ The authors can be contacted at <info@libzip.org>
 
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
index 91a6935..8d1a2aa 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index ac6e109..0d74d1a 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 58b797d..b198be5 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 1eae1b7..01828cc 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2018 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 406fceb..1a25aa1 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 6743186..dc8b97a 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 09cdf09..95ac899 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index a82b2fd..1151fff 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index f67faf7..acbfe4b 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 548ab28..030e67e 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 8202bfe..6dc1bb1 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index be9fdc6..a533fe2 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 7d82d9a..676c16b 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 89eb432..42ba5e8 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 0fb627e..4615fc6 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 42f4eb8..d1dc4f8 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index dfc6419..35a36e4 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 6c7e49f..5fc2e83 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index f655539..94ff506 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index f310ed3..c0418f0 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index d9eb47a..a22ffb0 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index c283d88..2a1fbaf 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index f13ac19..acd91c9 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 8983f75..92cec01 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 9a828e4..cd143f3 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 3984b98..b820d98 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index c2708c6..5cd4391 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 02b6599..c2c41e1 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index b47e3d2..a10bff8 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index cce1ac2..b93117b 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 59b768a..fa998f0 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index f642918..a79bb3e 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2013-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index c9c8fd8..213f7d3 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index d65f64a..9ac2581 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index a8cf86c..4262d45 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 0276a47..f50953b 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index aa0d707..41392c1 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 6ca01f2..1a0028d 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2013-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 774328a..10abe81 100644 (file)
@@ -3,7 +3,7 @@
  Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner
 
  This file is part of libzip, a library to manipulate ZIP archives.
- The authors can be contacted at <libzip@nih.at>
+ The authors can be contacted at <info@libzip.org>
 
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
index e21c1dc..5b5a009 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 513f78b..e3cde9b 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 5a48437..d5880dc 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 1f7ce8c..a449b83 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index dfdeffa..a69dfb9 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index edad9d2..22fabe3 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 2eeab81..3313615 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
@@ -57,5 +57,5 @@ zip_file_is_seekable(zip_file_t *zfile) {
         return -1;
     }
     
-    return (zip_source_supports(zfile->src) & ZIP_SOURCE_SEEK) != 0;
+    return ZIP_SOURCE_CHECK_SUPPORTED(zip_source_supports(zfile->src), ZIP_SOURCE_SEEK);
 }
index 42067a1..7a3cda0 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 6752380..ea9a00a 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index e4d412c..fc200bd 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2008-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 191e805..72e48fe 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index dd11816..d58e22b 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 8777868..4828d78 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 16d901c..667dc51 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 1c6d6bb..140e34f 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index e01d935..d3a954e 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2015-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 3ee3670..0a1e4d5 100644 (file)
@@ -3,7 +3,7 @@
  Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
  This file is part of libzip, a library to manipulate ZIP archives.
- The authors can be contacted at <libzip@nih.at>
+ The authors can be contacted at <info@libzip.org>
 
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
index 6e20724..4200727 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 8f6175b..38459d8 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index ca92b5c..806053c 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 3768d5b..4f69c8a 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 1b659e8..96f4dbc 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 1b1b461..6a8c9fc 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index a881df4..e080514 100644 (file)
@@ -3,7 +3,7 @@
  Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner
 
  This file is part of libzip, a library to manipulate ZIP archives.
- The authors can be contacted at <libzip@nih.at>
+ The authors can be contacted at <info@libzip.org>
 
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
index da44d3c..f84a548 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 7a644ef..9f842b9 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 436306b..966b9a5 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 3e67b7c..c89b06c 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index e9a2973..96c083c 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index ee6f2ba..9063710 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index a5afc81..610409d 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2008-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 625ac3f..4bab513 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 2e7dcb7..5d2b0b8 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index d2027c9..1a19fb7 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index af4ec93..f1bf703 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 10f4012..d6a0495 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2019-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index cefb809..3781832 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 71911e7..fc1bc26 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index baf687f..04cd4f0 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
@@ -376,6 +376,10 @@ static zip_uint64_t
 buffer_find_fragment(const buffer_t *buffer, zip_uint64_t offset) {
     zip_uint64_t low, high, mid;
 
+    if (buffer->nfragments == 0) {
+        return 0;
+    }
+
     low = 0;
     high = buffer->nfragments - 1;
 
index 41b5c0f..8c98fc2 100644 (file)
@@ -3,7 +3,7 @@
  Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
  This file is part of libzip, a library to manipulate ZIP archives.
- The authors can be contacted at <libzip@nih.at>
+ The authors can be contacted at <info@libzip.org>
 
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
index 48efe8a..f4f3ff2 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 30243d5..3e699ec 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 9776065..0b849de 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index ebbeaa7..37ea022 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 042901f..dc7fa20 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 40d87dd..cca9fd2 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2020-2022 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 0012395..e92a43b 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 1581771..c4e3f8a 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 1bf698c..87436b6 100644 (file)
@@ -6,7 +6,7 @@
   Copyright (C) 2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 7841b86..92ae344 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 703ffac..4708dc8 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 88e45b1..f012326 100644 (file)
@@ -6,7 +6,7 @@
   Copyright (C) 2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index f299692..9b8f180 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 1fe5591..d154728 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 6aef2bb..08443d3 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index d6728e3..687c30f 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 2e6944e..1a80040 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index de9f58d..e4eac9d 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 734767a..df7ad58 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index c2c7eb5..838aa90 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index f6db2a7..3c21441 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index b12a4c2..7116bef 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index a1c9e3a..01b6417 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 7c77e1e..5958af4 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index ee7686a..0938fcb 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 46230cd..c94fa1e 100644 (file)
@@ -3,7 +3,7 @@
  Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
  This file is part of libzip, a library to manipulate ZIP archives.
- The authors can be contacted at <libzip@nih.at>
+ The authors can be contacted at <info@libzip.org>
 
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
index 6f98c39..13aa097 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 1acd6d8..e3baad5 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 5599bcb..30f1643 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index a9745e0..e7954e7 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 66a5303..ff8e478 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 8518739..49057ce 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 8edee67..4b96535 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 6f457b6..7e4d8ed 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 2999654..a3d978d 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 44c4e4b..73586ba 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index bb72b14..24dde9b 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index e6cedaf..737fa4d 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index cf3d267..68394b7 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 4b7c495..51d8026 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 62dc045..fb532ec 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index f513bde..9c6088a 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index e22db65..7d82793 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 7013315..570a8fa 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 46a14fa..d69a3df 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 7b0a4c0..34f3702 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index a0616cc..56a8e31 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 153c839..6bdecd1 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index ebf67fa..678912f 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2011-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index b36e46c..74a003f 100644 (file)
@@ -3,7 +3,7 @@
   Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index a34f42c..7594220 100644 (file)
@@ -6,7 +6,7 @@
   Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
-  The authors can be contacted at <libzip@nih.at>
+  The authors can be contacted at <info@libzip.org>
 
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
index 807dd49..a1117c2 100644 (file)
--- a/man/links
+++ b/man/links
@@ -10,6 +10,7 @@ zip_file_set_mtime zip_file_set_dostime
 zip_file_strerror zip_strerror
 zip_fopen zip_fopen_index
 zip_fopen_encrypted zip_fopen_index_encrypted
+zip_fseek zip_file_is_seekable
 zip_open zip_open_from_source
 zip_source_begin_write zip_source_begin_write_cloning
 zip_source_buffer zip_source_buffer_create
index 752dbbf..cfb51b7 100644 (file)
@@ -320,6 +320,7 @@ sub runtest_one {
        my ($self, $tag) = @_;
 
        $ENV{TZ} = "UTC";
+       $ENV{LANG} = "C";
        $ENV{LC_CTYPE} = "C";
        $ENV{POSIXLY_CORRECT} = 1;
        $self->sandbox_create($tag);
index 3bb51c9..97035b0 100644 (file)
@@ -1,5 +1,4 @@
 # try opening simulated Android APK zipaligned files, and similar inconsistent files
-setenv LANG C
 program tryopen
 file extra_field_align_1-0.zzip extra_field_align_1-0.zip extra_field_align_1-0.zip
 file extra_field_align_1-ff.zzip extra_field_align_1-ff.zip extra_field_align_1-ff.zip
index 1f18deb..e510647 100644 (file)
@@ -1,5 +1,4 @@
 # zip_open: various inconsistent files
-setenv LANG C
 program tryopen
 file incons-file-count-high.zzip incons-file-count-high.zip incons-file-count-high.zip
 file incons-file-count-low.zzip incons-file-count-low.zip incons-file-count-low.zip
index c0e63a0..768980f 100644 (file)
@@ -1,5 +1,4 @@
 # zip_open: various inconsistent files
-setenv LANG C
 program tryopen
 file incons-archive-comment-longer.zzip incons-archive-comment-longer.zip incons-archive-comment-longer.zip
 file incons-archive-comment-shorter.zzip incons-archive-comment-shorter.zip incons-archive-comment-shorter.zip
index 6b853b8..7e6efb3 100644 (file)
@@ -13,6 +13,8 @@ zip_uint64_t fragment_size = 0;
 
 static int add_nul(char *argv[]);
 static int cancel(char *argv[]);
+static int is_seekable(char *argv[]);
+static int seek(char *argv[]);
 static int unchange_one(char *argv[]);
 static int unchange_all(char *argv[]);
 static int zin_close(char *argv[]);
@@ -37,6 +39,8 @@ static int zin_close(char *argv[]);
 #define DISPATCH_REGRESS \
     {"add_nul", 2, "name length", "add NUL bytes", add_nul}, \
     {"cancel", 1, "limit", "cancel writing archive when limit% have been written (calls print_progress)", cancel}, \
+    {"is_seekable", 1, "index", "report if entry is seekable", is_seekable}, \
+    {"seek", 2, "index offset", "seek in entry to offset", seek}, \
     {"unchange", 1, "index", "revert changes for entry", unchange_one}, \
     {"unchange_all", 0, "", "revert all changes", unchange_all}, \
     { "zin_close", 1, "index", "close input zip_source (for internal tests)", zin_close }
@@ -77,52 +81,94 @@ add_nul(char *argv[]) {
 }
 
 static int
-unchange_all(char *argv[]) {
-    if (zip_unchange_all(za) < 0) {
-        fprintf(stderr, "can't revert changes to archive: %s\n", zip_strerror(za));
+cancel_callback(zip_t *archive, void *ud) {
+    if (progress_userdata.percentage >= progress_userdata.limit) {
         return -1;
     }
     return 0;
 }
 
+static int
+cancel(char *argv[]) {
+    zip_int64_t percent;
+    percent = strtoll(argv[0], NULL, 10);
+    if (percent > 100 || percent < 0) {
+        fprintf(stderr, "invalid percentage '%" PRId64 "' for cancel (valid: 0 <= x <= 100)\n", percent);
+        return -1;
+    }
+    progress_userdata.limit = ((double)percent) / 100;
+
+    zip_register_cancel_callback_with_state(za, cancel_callback, NULL, NULL);
+
+    /* needs the percentage updates from print_progress */
+    print_progress(argv);
+    return 0;
+}
 
 static int
-unchange_one(char *argv[]) {
+is_seekable(char *argv[]) {
     zip_uint64_t idx;
+    zip_file_t *zf;
 
     idx = strtoull(argv[0], NULL, 10);
-
-    if (zip_unchange(za, idx) < 0) {
-       fprintf(stderr, "can't revert changes for entry %" PRIu64 ": %s", idx, zip_strerror(za));
+    if ((zf = zip_fopen_index(za, idx, 0)) == NULL) {
+        fprintf(stderr, "can't open file at index '%" PRIu64 "': %s\n", idx, zip_strerror(za));
+        return -1;
+    }
+    switch (zip_file_is_seekable(zf)) {
+    case -1:
+       fprintf(stderr, "can't check if file %" PRIu64 " is seekable: %s\n", idx, zip_strerror(za));
        return -1;
+    case 0:
+       printf("%" PRIu64 ": NOT seekable\n", idx);
+       break;
+    case 1:
+       printf("%" PRIu64 ": seekable\n", idx);
+       break;
     }
-
     return 0;
 }
 
-
 static int
-cancel_callback(zip_t *archive, void *ud) {
-    if (progress_userdata.percentage >= progress_userdata.limit) {
+seek(char *argv[]) {
+    zip_uint64_t idx;
+    zip_file_t *zf;
+    zip_int64_t offset;
+
+    idx = strtoull(argv[0], NULL, 10);
+    offset = strtoull(argv[1], NULL, 10);
+    if ((zf = zip_fopen_index(za, idx, 0)) == NULL) {
+        fprintf(stderr, "can't open file at index '%" PRIu64 "': %s\n", idx, zip_strerror(za));
         return -1;
     }
+    if (zip_fseek(zf, offset, SEEK_SET) == -1) {
+       fprintf(stderr, "can't seek in file %" PRIu64 ": %s\n", idx, zip_strerror(za));
+       return -1;
+    }
     return 0;
 }
 
 static int
-cancel(char *argv[]) {
-    zip_int64_t percent;
-    percent = strtoll(argv[0], NULL, 10);
-    if (percent > 100 || percent < 0) {
-        fprintf(stderr, "invalid percentage '%" PRId64 "' for cancel (valid: 0 <= x <= 100)\n", percent);
+unchange_all(char *argv[]) {
+    if (zip_unchange_all(za) < 0) {
+        fprintf(stderr, "can't revert changes to archive: %s\n", zip_strerror(za));
         return -1;
     }
-    progress_userdata.limit = ((double)percent) / 100;
+    return 0;
+}
 
-    zip_register_cancel_callback_with_state(za, cancel_callback, NULL, NULL);
 
-    /* needs the percentage updates from print_progress */
-    print_progress(argv);
+static int
+unchange_one(char *argv[]) {
+    zip_uint64_t idx;
+
+    idx = strtoull(argv[0], NULL, 10);
+
+    if (zip_unchange(za, idx) < 0) {
+       fprintf(stderr, "can't revert changes for entry %" PRIu64 ": %s", idx, zip_strerror(za));
+       return -1;
+    }
+
     return 0;
 }