rasmus Wed Mar 10 14:12:52 2004 EDT
Modified files:
/php-src/ext/standard basic_functions.c
Log:
getopt() doesn't work if variables_order does not include "S" because it
only looks in $_SERVER for argv. So, if we don't find argv in $_SERVER
fall back to looking in the global symbol table where register_argc_argv
would have put it.
http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.653&r2=1.654&ty=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.653
php-src/ext/standard/basic_functions.c:1.654
--- php-src/ext/standard/basic_functions.c:1.653 Mon Jan 19 14:01:17 2004
+++ php-src/ext/standard/basic_functions.c Wed Mar 10 14:12:49 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.653 2004/01/19 19:01:17 sniper Exp $ */
+/* $Id: basic_functions.c,v 1.654 2004/03/10 19:12:49 rasmus Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -1405,8 +1405,8 @@
* in order to be on the safe side, even though it is also available
* from the symbol table.
*/
- if (zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv",
sizeof("argv"),
- (void **) &args) != FAILURE) {
+ if (zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv",
sizeof("argv"), (void **) &args) != FAILURE ||
+ zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void **)
&args) != FAILURE) {
int pos = 0;
zval **arg;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php