Re: strange problem
| From: | Andrei Zmievski | Date: | Wed, 09 May 2001 21:08:40 +0000 |
| Subject: | Re: strange problem | ||
| References: | 1 2 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-1773@lists.php.net to get a copy of this message | ||
It looks like something is messing up argc/argv that are being passed to
gtk_init(). Those are obtained from $HTTP_SERVER_VARS array, but I can't
see how compiling with imap would mess with that...
Does the attached patch help?
-Andrei
"Science is like sex: sometimes something useful comes out,
but that is not the reason we are doing it" -- Richard Feynman
Index: src/php_gtk.c =================================================================== RCS file: /repository/php-gtk/src/php_gtk.c,v retrieving revision 1.11 diff -u -r1.11 php_gtk.c --- src/php_gtk.c 2001/05/04 04:31:40 1.11 +++ src/php_gtk.c 2001/05/09 21:06:33 @@ -46,7 +46,7 @@ static void init_gtk(void) { HashTable *symbol_table; - zval **z_argv, **z_argc, **entry; + zval **z_argv = NULL, **z_argc = NULL, **entry; zval *tmp; char **argv; int argc, i; @@ -69,9 +69,9 @@ */ symbol_table = PG(http_globals)[TRACK_VARS_SERVER]->value.ht; - zend_hash_find(&EG(symbol_table), "argc", sizeof("argc"), (void **)&z_argc); + zend_hash_find(symbol_table, "argc", sizeof("argc"), (void **)&z_argc); zend_hash_find(symbol_table, "argv", sizeof("argv"), (void **)&z_argv); - if (Z_TYPE_PP(z_argc) != IS_LONG || Z_TYPE_PP(z_argv) != IS_ARRAY) { + if (!z_argc || !z_argv || Z_TYPE_PP(z_argc) != IS_LONG || Z_TYPE_PP(z_argv) != IS_ARRAY) { php_error(E_ERROR, "php-gtk: argc/argv are corrupted"); }
Index: src/php_gtk.c =================================================================== RCS file: /repository/php-gtk/src/php_gtk.c,v retrieving revision 1.11 diff -u -r1.11 php_gtk.c --- src/php_gtk.c 2001/05/04 04:31:40 1.11 +++ src/php_gtk.c 2001/05/09 21:06:33 @@ -46,7 +46,7 @@ static void init_gtk(void) { HashTable *symbol_table; - zval **z_argv, **z_argc, **entry; + zval **z_argv = NULL, **z_argc = NULL, **entry; zval *tmp; char **argv; int argc, i; @@ -69,9 +69,9 @@ */ symbol_table = PG(http_globals)[TRACK_VARS_SERVER]->value.ht; - zend_hash_find(&EG(symbol_table), "argc", sizeof("argc"), (void **)&z_argc); + zend_hash_find(symbol_table, "argc", sizeof("argc"), (void **)&z_argc); zend_hash_find(symbol_table, "argv", sizeof("argv"), (void **)&z_argv); - if (Z_TYPE_PP(z_argc) != IS_LONG || Z_TYPE_PP(z_argv) != IS_ARRAY) { + if (!z_argc || !z_argv || Z_TYPE_PP(z_argc) != IS_LONG || Z_TYPE_PP(z_argv) != IS_ARRAY) { php_error(E_ERROR, "php-gtk: argc/argv are corrupted"); }