It's a hacky solution and incomplete, but I don't see other way
without refactoring the whole getopt protocol.
?? ??? 2014, PHP 5.5.19
- Core:
+ . Fixed bug #68095 (AddressSanitizer reports a heap buffer overflow in
+ php_getopt()). (Stas)
. Fixed bug #68118 ($a->foo .= 'test'; can leave $a->foo undefined). (Nikita)
. Fixed bug #68129 (parse_url() - incomplete support for empty usernames
and passwords) (Tjerk)
{
static int optchr = 0;
static int dash = 0; /* have already seen the - */
+ static char **prev_optarg = NULL;
php_optidx = -1;
+ if(prev_optarg && prev_optarg != optarg) {
+ /* reset the state */
+ optchr = 0;
+ dash = 0;
+ }
+ prev_optarg = optarg;
+
if (*optind >= argc) {
return(EOF);
}