From 6a4d61ba3b94114eed93811ea1a8ea81d5c187ba Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Tue, 6 Apr 2010 01:32:30 +0200 Subject: win32: getopt32: set optind = 0 on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I haven't dug deep into this, but experiments show that optind = 1 does not work. Maybe MinGW guys took getopt from glibc? Signed-off-by: Nguyễn Thái Ngọc Duy --- libbb/getopt32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libbb/getopt32.c b/libbb/getopt32.c index b5f83c127..20e1b8a8b 100644 --- a/libbb/getopt32.c +++ b/libbb/getopt32.c @@ -534,7 +534,7 @@ getopt32(char **argv, const char *applet_opts, ...) * run_nofork_applet_prime() does this, but we might end up here * also via gunzip_main() -> gzip_main(). Play safe. */ -#ifdef __GLIBC__ +#if defined(__GLIBC__) || ENABLE_PLATFORM_MINGW32 optind = 0; #else /* BSD style */ optind = 1; -- cgit v1.2.3-55-g6feb