From a2a69a3ba2d704be971e7b48502077ebc5d1d45e Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 13 Apr 2006 13:48:40 +0000 Subject: [PATCH] Fixed bug #36513 (comment will be outputed in last line) --- Zend/tests/bug36513.phpt | 22 ++++++++++++++++++++++ Zend/zend_language_scanner.l | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100755 Zend/tests/bug36513.phpt diff --git a/Zend/tests/bug36513.phpt b/Zend/tests/bug36513.phpt new file mode 100755 index 0000000000..f46da4efc5 --- /dev/null +++ b/Zend/tests/bug36513.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #36513 (comment will be outputed in last line) +--FILE-- +5'); +echo "\n"; + +//test('5'); +?> +--EXPECT-- +135 +'5' diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index 778e26a0f0..5baed5057d 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -2107,7 +2107,7 @@ NEWLINE ("\r"|"\n"|"\r\n") yymore(); } -[^\n\r?%>]+{ANY_CHAR} { +[^\n\r?%>]*{ANY_CHAR} { switch (yytext[yyleng-1]) { case '?': case '%': case '>': yyless(yyleng-1); @@ -2137,7 +2137,7 @@ NEWLINE ("\r"|"\n"|"\r\n") "?>"|"%>" { if (CG(asp_tags) || yytext[yyleng-2] != '%') { /* asp comment? */ Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */ - Z_STRLEN_P(zendlval) = yyleng; + Z_STRLEN_P(zendlval) = yyleng-2; Z_TYPE_P(zendlval) = IS_STRING; yyless(yyleng-2); BEGIN(ST_IN_SCRIPTING); -- 2.50.1