cvs: ZendEngine2 / zend.c

"Marcus Boerger" <[email protected]>
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvshelly1215984618@cvsserver>
helly		Sun Jul 13 21:30:18 2008 UTC

  Modified files:              
    /ZendEngine2	zend.c 
  Log:
  - Fix function copying (in TSRM mode)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.c?r1=1.417&r2=1.418&diff_format=u
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.417 ZendEngine2/zend.c:1.418
--- ZendEngine2/zend.c:1.417	Tue May 20 15:03:13 2008
+++ ZendEngine2/zend.c	Sun Jul 13 21:30:18 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend.c,v 1.417 2008/05/20 15:03:13 tony2001 Exp $ */
+/* $Id: zend.c,v 1.418 2008/07/13 21:30:18 helly Exp $ */
 
 #include "zend.h"
 #include "zend_extensions.h"
@@ -737,12 +737,16 @@
 static void function_to_unicode(zend_function *func TSRMLS_DC) /* {{{ */
 {
 	if (func->common.function_name.s) {
-		UChar *uname;
-		int len = strlen(func->common.function_name.s) + 1;
-
-		uname = malloc(UBYTES(len));
-		u_charsToUChars(func->common.function_name.s, uname, len);
-		func->common.function_name.u = uname;
+		if (UG(unicode)) {
+			func->common.function_name.u = zend_ustrdup(func->common.function_name.u);
+		} else {
+			UChar *uname;
+			int len = strlen(func->common.function_name.s) + 1;
+	
+			uname = malloc(UBYTES(len));
+			u_charsToUChars(func->common.function_name.s, uname, len);
+			func->common.function_name.u = uname;
+		}
 	}
 	if (func->common.arg_info) {
 		zend_arg_info *args;



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.