cvs: ZendEngine2 / zend_API.c

From: Date: Wed, 19 Mar 2003 21:07:50 +0000
Subject: cvs: ZendEngine2 / zend_API.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1051@lists.php.net to get a copy of this message
andrei Wed Mar 19 16:07:50 2003 EDT Modified files: /ZendEngine2 zend_API.c Log: Lowercase the function name when used as key in the function name. The original case is still preserved in zend_function structure. Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.158 ZendEngine2/zend_API.c:1.159 --- ZendEngine2/zend_API.c:1.158 Thu Mar 13 15:41:58 2003 +++ ZendEngine2/zend_API.c Wed Mar 19 16:07:49 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.158 2003/03/13 20:41:58 andrei Exp $ */ +/* $Id: zend_API.c,v 1.159 2003/03/19 21:07:49 andrei Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -1146,6 +1146,8 @@ HashTable *target_function_table = function_table; int error_type; zend_function *ctor = NULL, *dtor = NULL, *clone = NULL; + char *lowercase_name; + int fname_len; if (type==MODULE_PERSISTENT) { error_type = E_CORE_WARNING; @@ -1170,8 +1172,13 @@ zend_unregister_functions(functions, count, target_function_table TSRMLS_CC); return FAILURE; } - if (zend_hash_add(target_function_table, ptr->fname, strlen(ptr->fname)+1, &function, sizeof(zend_function), (void**)&reg_function) == FAILURE) { + fname_len = strlen(ptr->fname); + lowercase_name = do_alloca(fname_len+1); + memcpy(lowercase_name, ptr->fname, fname_len+1); + zend_str_tolower(lowercase_name, fname_len); + if (zend_hash_add(target_function_table, lowercase_name, fname_len+1, &function, sizeof(zend_function), (void**)&reg_function) == FAILURE) { unload=1; + free_alloca(lowercase_name); break; } if (scope) { @@ -1191,6 +1198,7 @@ } ptr++; count++; + free_alloca(lowercase_name); } if (unload) { /* before unloading, display all remaining bad function in the module */ while (ptr->fname) {

« previous php.zend-engine.cvs (#1051) next »