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 <pclo...@gmail.com> --- libbb/getopt32.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libbb/getopt32.c b/libbb/getopt32.c index b5f83c1..f7d77cb 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_TARGET_WIN32 optind = 0; #else /* BSD style */ optind = 1;
_______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox