]> granicus.if.org Git - php/commitdiff
Fixed a function overloading related bug.
authorMoriyoshi Koizumi <moriyoshi@php.net>
Tue, 12 Nov 2002 21:58:53 +0000 (21:58 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Tue, 12 Nov 2002 21:58:53 +0000 (21:58 +0000)
# Yet I suspect the problem is in another place...

ext/mbstring/mbstring.c

index 4a4c6363a052a920c7a6bdf3d53c529034be0aa7..83d39eadc9c893fd18d47d1844d87ac2e08b12b0 100644 (file)
@@ -916,11 +916,12 @@ PHP_RINIT_FUNCTION(mbstring)
                                if (zend_hash_find(EG(function_table), p->orig_func, 
                                                                   strlen(p->orig_func)+1, (void **)&orig) != SUCCESS) {
                                        php_error_docref("ref.mbstring" TSRMLS_CC, E_ERROR, "mbstring couldn't find function %s.", p->orig_func);
-                               }
-                               zend_hash_add(EG(function_table), p->save_func, strlen(p->save_func)+1, orig, sizeof(zend_function), NULL);
-                               if (zend_hash_update(EG(function_table), p->orig_func, strlen(p->orig_func)+1,
+                               } else {
+                                       zend_hash_add(EG(function_table), p->save_func, strlen(p->save_func)+1, orig, sizeof(zend_function), NULL);
+                                       if (zend_hash_update(EG(function_table), p->orig_func, strlen(p->orig_func)+1,
                                                                         func, sizeof(zend_function), NULL) == FAILURE){
-                                       php_error_docref("ref.mbstring" TSRMLS_CC, E_ERROR, "mbstring couldn't replace function %s.", p->orig_func);
+                                               php_error_docref("ref.mbstring" TSRMLS_CC, E_ERROR, "mbstring couldn't replace function %s.", p->orig_func);
+                                       }
                                }
                        }
                        p++;