moriyoshi               Mon Jul 28 07:01:54 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /php-src/ext/mbstring/tests zend_multibyte-14.phpt 

  Modified files:              
    /ZendEngine2        zend_language_scanner.l 
  Log:
  - SCNG(input_filter) can be null if the script encoding is idential to
    the internal encoding.
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_language_scanner.l?r1=1.131.2.11.2.13.2.27&r2=1.131.2.11.2.13.2.28&diff_format=u
Index: ZendEngine2/zend_language_scanner.l
diff -u ZendEngine2/zend_language_scanner.l:1.131.2.11.2.13.2.27 
ZendEngine2/zend_language_scanner.l:1.131.2.11.2.13.2.28
--- ZendEngine2/zend_language_scanner.l:1.131.2.11.2.13.2.27    Mon Jul 28 
06:05:14 2008
+++ ZendEngine2/zend_language_scanner.l Mon Jul 28 07:01:54 2008
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_language_scanner.l,v 1.131.2.11.2.13.2.27 2008/07/28 06:05:14 
moriyoshi Exp $ */
+/* $Id: zend_language_scanner.l,v 1.131.2.11.2.13.2.28 2008/07/28 07:01:54 
moriyoshi Exp $ */
 
 #if 0
 # define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c)
@@ -448,20 +448,21 @@
 {
        size_t offset = SCNG(yy_cursor) - SCNG(yy_start);
 #ifdef ZEND_MULTIBYTE
-       size_t original_offset = offset, length = 0;
-       do {
-               unsigned char *p = NULL;
-               SCNG(input_filter)(&p, &length, SCNG(script_org), offset 
TSRMLS_CC);
-               if (!p) {
-                       break;
-               }
-               efree(p);
-               if (length > original_offset) {
-                       offset--;
-               } else if (length < original_offset) {
-                       offset++;
-               }
-       } while (original_offset != length);
+       if (SCNG(input_filter)) {
+               size_t original_offset = offset, length = 0; do {
+                       unsigned char *p = NULL;
+                       SCNG(input_filter)(&p, &length, SCNG(script_org), 
offset TSRMLS_CC);
+                       if (!p) {
+                               break;
+                       }
+                       efree(p);
+                       if (length > original_offset) {
+                               offset--;
+                       } else if (length < original_offset) {
+                               offset++;
+                       }
+               } while (original_offset != length);
+       }
 #endif
        return offset;
 }
@@ -607,7 +608,7 @@
                zend_encoding *new_encoding = SCNG(script_encoding);
                zend_encoding_filter new_filter = SCNG(input_filter);
                SCNG(script_encoding) = old_encoding;
-               SCNG(input_filter) = new_filter;
+               SCNG(input_filter) = old_input_filter;
                offset = zend_get_scanned_file_offset(TSRMLS_C);
                SCNG(script_encoding) = new_encoding;
                SCNG(input_filter) = new_filter;

http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/tests/zend_multibyte-14.phpt?view=markup&rev=1.1
Index: php-src/ext/mbstring/tests/zend_multibyte-14.phpt
+++ php-src/ext/mbstring/tests/zend_multibyte-14.phpt



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to