cvs: php4 /main main.c

From: Date: Wed, 21 May 2003 22:56:59 +0000
Subject: cvs: php4 /main main.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-21199@lists.php.net to get a copy of this message
iliaa Wed May 21 18:56:59 2003 EDT Modified files: /php4/main main.c Log: MFB Index: php4/main/main.c diff -u php4/main/main.c:1.554 php4/main/main.c:1.555 --- php4/main/main.c:1.554 Tue May 13 18:08:48 2003 +++ php4/main/main.c Wed May 21 18:56:59 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.554 2003/05/13 22:08:48 iliaa Exp $ */ +/* $Id: main.c,v 1.555 2003/05/21 22:56:59 iliaa Exp $ */ /* {{{ includes */ @@ -1521,12 +1521,15 @@ zend_hash_internal_pointer_reset_ex(src, &pos); while (zend_hash_get_current_data_ex(src, (void **)&src_entry, &pos) == SUCCESS) { key_type = zend_hash_get_current_key_ex(src, &string_key, &string_key_len, &num_key, 0, &pos); - if (Z_TYPE_PP(src_entry) != IS_ARRAY || (zend_hash_find(dest, string_key, string_key_len, (void **)&dest_entry) != SUCCESS) || Z_TYPE_PP(dest_entry) != IS_ARRAY) { + if (Z_TYPE_PP(src_entry) != IS_ARRAY || + (string_key_len && zend_hash_find(dest, string_key, string_key_len, (void **)&dest_entry) != SUCCESS) || + (!string_key_len && zend_hash_index_find(dest, num_key, (void **)&dest_entry) != SUCCESS) + || Z_TYPE_PP(dest_entry) != IS_ARRAY) { (*src_entry)->refcount++; if (key_type == HASH_KEY_IS_STRING) { zend_hash_update(dest, string_key, strlen(string_key)+1, src_entry, sizeof(zval *), NULL); } else { - zend_hash_next_index_insert(dest, src_entry, sizeof(zval *), NULL); + zend_hash_index_update(dest, num_key, src_entry, sizeof(zval *), NULL); } } else { SEPARATE_ZVAL(dest_entry);

« previous php.cvs (#21199) next »