]> granicus.if.org Git - php/commitdiff
MFB
authorNuno Lopes <nlopess@php.net>
Sun, 6 Jul 2008 16:42:10 +0000 (16:42 +0000)
committerNuno Lopes <nlopess@php.net>
Sun, 6 Jul 2008 16:42:10 +0000 (16:42 +0000)
Zend/zend_language_scanner.l
sapi/cli/tests/016.phpt

index af38c9c8480f857e3a7e4366602fa3b6b19e6c61..4858257a472570cd99509627946cdbc7ee9522cb 100644 (file)
@@ -2159,12 +2159,15 @@ NOWDOC_CHARS            ({NEWLINE}*(([^a-zA-Z_\x7f-\xff\n\r][^\n\r]*)|({LABEL}[^a-zA-Z0-9_
                /* ignore first line when it's started with a # */
                goto restart;
        } else {
+               YYCURSOR = yytext+1;
                goto inline_char_handler;
        }
 }
 
 <INITIAL>{ANY_CHAR} {
 
+inline_char_handler:
+
        while (1) {
                YYCTYPE *ptr = memchr(YYCURSOR, '<', YYLIMIT - YYCURSOR);
 
@@ -2177,7 +2180,7 @@ NOWDOC_CHARS              ({NEWLINE}*(([^a-zA-Z_\x7f-\xff\n\r][^\n\r]*)|({LABEL}[^a-zA-Z0-9_
                        YYCURSOR = ptr + 1;
 
                        /* if it can be an opening tag, stop */
-                       if (ptr < YYLIMIT && (*YYCURSOR == '?' || *YYCURSOR == '%')) {
+                       if (YYCURSOR < YYLIMIT && (*YYCURSOR == '?' || *YYCURSOR == '%')) {
                                --YYCURSOR;
                                yyleng = YYCURSOR - SCNG(yy_text);
                                break;
@@ -2185,8 +2188,6 @@ NOWDOC_CHARS              ({NEWLINE}*(([^a-zA-Z_\x7f-\xff\n\r][^\n\r]*)|({LABEL}[^a-zA-Z0-9_
                }
        }
 
-inline_char_handler:
-
        Z_STRVAL_P(zendlval) = (char *) estrndup(yytext, yyleng);
        Z_STRLEN_P(zendlval) = yyleng;
        Z_TYPE_P(zendlval) = IS_STRING;
index 0b90844f373f2ccb8ee3a96622f79f91c6ba97a8..adde106df00e1c6a1d68012127d522e6dc7e8dc2 100644 (file)
@@ -11,6 +11,9 @@ if (!extension_loaded('readline') || readline_info('done') === NULL) {
 <?php
 $php = getenv('TEST_PHP_EXECUTABLE');
 
+// disallow console escape sequences that may break the output
+putenv('TERM=VT100');
+
 $codes = array();
 
 $codes[1] = <<<EOT