From 72a87da001345b76e40f1a7befd3347beaff99f7 Mon Sep 17 00:00:00 2001 From: Mingye Wang Date: Mon, 17 Feb 2020 00:24:56 +0800 Subject: [PATCH 1/3] unzip: support glibc builds People are showing interest in replacing some old utils, and unzip is an existing program we can use here. Ref: https://github.com/libarchive/libarchive/issues/1138 --- unzip.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/unzip.c b/unzip.c index c9e53f2..1828b8b 100644 --- a/unzip.c +++ b/unzip.c @@ -36,6 +36,10 @@ * options. */ +#ifdef __GLIBC__ +#define _GNU_SOURCE +#endif + #include #include @@ -944,7 +948,11 @@ getopts(int argc, char *argv[]) { int opt; +#ifdef __GLIBC__ + optind = 0; +#else optreset = optind = 1; +#endif while ((opt = getopt(argc, argv, "aCcd:fjLlnopqtuvx:yZ1")) != -1) switch (opt) { case '1': -- 2.24.0.windows.2