summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuno Lopes <nlopess@php.net>2008-07-06 16:42:10 +0000
committerNuno Lopes <nlopess@php.net>2008-07-06 16:42:10 +0000
commit96258d4a76473bf2bd9d7cf506b21cbfb80906fd (patch)
tree87c036575350a67b91072fa513b5b3603be65b60
parentd6ad0c20da071613acfcb82deb9d170471132087 (diff)
downloadphp-git-96258d4a76473bf2bd9d7cf506b21cbfb80906fd.tar.gz
MFB
-rw-r--r--Zend/zend_language_scanner.l7
-rw-r--r--sapi/cli/tests/016.phpt3
2 files changed, 7 insertions, 3 deletions
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index af38c9c848..4858257a47 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -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;
diff --git a/sapi/cli/tests/016.phpt b/sapi/cli/tests/016.phpt
index 0b90844f37..adde106df0 100644
--- a/sapi/cli/tests/016.phpt
+++ b/sapi/cli/tests/016.phpt
@@ -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