iliaa           Wed Dec  7 22:25:42 2005 EDT

  Modified files:              
    /php-src/ext/standard       basic_functions.c 
  Log:
  MFB51: Fixed bug #35594 (Multiple calls to getopt() may result in a crash).
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.740&r2=1.741&ty=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.740 
php-src/ext/standard/basic_functions.c:1.741
--- php-src/ext/standard/basic_functions.c:1.740        Mon Dec  5 17:53:16 2005
+++ php-src/ext/standard/basic_functions.c      Wed Dec  7 22:25:42 2005
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.740 2005/12/05 22:53:16 sniper Exp $ */
+/* $Id: basic_functions.c,v 1.741 2005/12/08 03:25:42 iliaa Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -1670,6 +1670,9 @@
        /* 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) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to