From fb7324bb71048bb320d2c97c4924aadc5ef3aaa0 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 17 Mar 2006 15:04:23 +0000 Subject: [PATCH] Fixed register_argc_argv --- main/php_variables.c | 4 ++-- tests/basic/011.phpt | 7 ------- tests/basic/bug29971.phpt | 1 + 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/main/php_variables.c b/main/php_variables.c index 8e2bb87f309..2bfe566a1a5 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -639,7 +639,7 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC) int count = 0; char *ss, *space; - if (!(SG(request_info).argc || track_vars_array)) { + if (!(SG(request_info).argc || (s && *s))) { return; } @@ -696,7 +696,7 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC) argc->is_ref = 0; argc->refcount = 0; - if (SG(request_info).argc) { + if (Z_LVAL_P(argc)) { arr->refcount++; argc->refcount++; zend_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL); diff --git a/tests/basic/011.phpt b/tests/basic/011.phpt index 34eed7915a0..14c0542ec1f 100644 --- a/tests/basic/011.phpt +++ b/tests/basic/011.phpt @@ -8,16 +8,9 @@ register_argc_argv=1 ab+cd+ef+123+test --FILE-- --EXPECT-- 0: ab diff --git a/tests/basic/bug29971.phpt b/tests/basic/bug29971.phpt index 1d2bc0b1c64..fdbee8fd469 100755 --- a/tests/basic/bug29971.phpt +++ b/tests/basic/bug29971.phpt @@ -2,6 +2,7 @@ Bug #29971 (variables_order behaviour) --INI-- variables_order=GPC +register_argc_argv=0 --FILE--