mirror of
https://github.com/php/php-src.git
synced 2024-09-24 11:27:28 +00:00
MFB51: Fixed bug #35594 (Multiple calls to getopt() may result in a crash).
This commit is contained in:
parent
04ee70f6eb
commit
331b7d7b27
@ -1670,6 +1670,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) {
|
||||
|
Loading…
Reference in New Issue
Block a user