From cf221de9b709355bd1d6af9bd6847583793f57b9 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 6 Apr 2023 19:45:21 +0200 Subject: [PATCH] Disable the getopt argument permutation on Android On Android operating systems, the getopt() function is posix compliant and thus the option processing stops when the first non-option is found. But the getopt_long() function permutes the argument vector, just like the GNU implementation. Using a leading '+' character in the option string disables the permutation again. --- examples/dctool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/dctool.c b/examples/dctool.c index 9d3f74b..62a15fc 100644 --- a/examples/dctool.c +++ b/examples/dctool.c @@ -50,7 +50,7 @@ #define RESET 1 #endif -#if defined(__GLIBC__) || defined(__MINGW32__) || defined(BSD) +#if defined(__GLIBC__) || defined(__MINGW32__) || defined(BSD) || defined(__ANDROID__) #define NOPERMUTATION "+" #else #define NOPERMUTATION ""