diff options
Diffstat (limited to 'ext/standard/basic_functions.c')
| -rw-r--r-- | ext/standard/basic_functions.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index f5d9661444..604ddf091d 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1665,6 +1665,9 @@ PHP_FUNCTION(getopt) /* Disable getopt()'s error messages. */ opterr = 0; + /* Force reinitialization of getopt() (via optind reset) on every call. */ + optind = 0; + /* Invoke getopt(3) on the argument array. */ #ifdef HARTMUT_0 while ((o = getopt_long(argc, argv, options, longopts, &longindex)) != -1) { |
