summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2003-04-01 18:56:26 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2003-04-01 18:56:26 +0000
commit1bb22a8bd090180b48202602a88cff9ae62c36fe (patch)
treef81bc37e1c1a80c11063a50305d04ffc6782f704 /ext/mbstring/php_mbregex.c
parent423147c1942b53b1bae6e6dc8ae3bc379f267e32 (diff)
downloadphp-git-1bb22a8bd090180b48202602a88cff9ae62c36fe.tar.gz
Reverted the last patch; the problem is elsewhere..
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 74246859ae..46b471e7ca 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -96,6 +96,7 @@ void _php_mb_regex_globals_ctor(zend_mbstring_globals *pglobals TSRMLS_DC)
{
MBSTRG(default_mbctype) = MBCTYPE_EUC;
MBSTRG(current_mbctype) = MBCTYPE_EUC;
+ zend_hash_init(&(MBSTRG(ht_rc)), 0, NULL, (void (*)(void *)) php_mb_regex_free_cache, 1);
MBSTRG(search_str) = (zval**)0;
MBSTRG(search_str_val) = (zval*)0;
MBSTRG(search_re) = (mb_regex_t*)0;
@@ -107,6 +108,7 @@ void _php_mb_regex_globals_ctor(zend_mbstring_globals *pglobals TSRMLS_DC)
/* {{{ _php_mb_regex_globals_dtor */
void _php_mb_regex_globals_dtor(zend_mbstring_globals *pglobals TSRMLS_DC)
{
+ zend_hash_destroy(&MBSTRG(ht_rc));
}
/* }}} */
@@ -136,7 +138,6 @@ PHP_MSHUTDOWN_FUNCTION(mb_regex)
PHP_RINIT_FUNCTION(mb_regex)
{
MBSTRG(regex_default_options) = MBRE_OPTION_POSIXLINE;
- zend_hash_init(&(MBSTRG(ht_rc)), 0, NULL, (void (*)(void *)) php_mb_regex_free_cache, 0);
return SUCCESS;
}
@@ -166,7 +167,7 @@ PHP_RSHUTDOWN_FUNCTION(mb_regex)
efree(MBSTRG(search_regs));
MBSTRG(search_regs) = (struct mbre_registers*)0;
}
- zend_hash_destroy(&MBSTRG(ht_rc));
+ zend_hash_clean(&MBSTRG(ht_rc));
return SUCCESS;
}
@@ -233,7 +234,7 @@ php_mbregex_compile_pattern(mb_regex_t *pre, const char *pattern, int patlen, in
const char *err_str = NULL;
mb_regex_t *rc = NULL;
- if(zend_hash_find(&MBSTRG(ht_rc), (char *)pattern, patlen+1, (void **) &rc) == FAILURE ||
+ if(1 || zend_hash_find(&MBSTRG(ht_rc), (char *)pattern, patlen+1, (void **) &rc) == FAILURE ||
rc->options != options || rc->mbctype != mbctype) {
memset(pre, 0, sizeof(*pre));
pre->fastmap = (char*)emalloc((1 << MBRE_BYTEWIDTH)*sizeof(char));