diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-06 01:32:30 +0200 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-10 18:50:01 +1000 |
commit | 1b7b544627ede6a6cae55730a9a92fa1dee6a777 (patch) | |
tree | 0fdc86acbbeb12b86a957420c06ef92e8bde1c1f | |
parent | 43992d86844f4fa77b6e6613ce62b96d0e115bd5 (diff) | |
download | busybox-w32-1b7b544627ede6a6cae55730a9a92fa1dee6a777.tar.gz busybox-w32-1b7b544627ede6a6cae55730a9a92fa1dee6a777.tar.bz2 busybox-w32-1b7b544627ede6a6cae55730a9a92fa1dee6a777.zip |
win32: getopt32: set optind = 0 on Windows
I haven't dug deep into this, but experiments show that optind = 1
does not work. Maybe MinGW guys took getopt from glibc?
-rw-r--r-- | libbb/getopt32.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, ...) | |||
534 | * run_nofork_applet_prime() does this, but we might end up here | 534 | * run_nofork_applet_prime() does this, but we might end up here |
535 | * also via gunzip_main() -> gzip_main(). Play safe. | 535 | * also via gunzip_main() -> gzip_main(). Play safe. |
536 | */ | 536 | */ |
537 | #ifdef __GLIBC__ | 537 | #if defined(__GLIBC__) || ENABLE_PLATFORM_MINGW32 |
538 | optind = 0; | 538 | optind = 0; |
539 | #else /* BSD style */ | 539 | #else /* BSD style */ |
540 | optind = 1; | 540 | optind = 1; |