From: Nuno Lopes Date: Sun, 6 Jul 2008 16:20:51 +0000 (+0000) Subject: fix last part of bug #44654 X-Git-Tag: php-5.3.0alpha1~482 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea11f6df43fb9d22d78421f944639ac728b35ff9;p=php fix last part of bug #44654 --- diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index e8b8cd7f43..1169c0d169 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -1620,6 +1620,7 @@ 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; } } @@ -1640,7 +1641,7 @@ inline_char_handler: 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; diff --git a/tests/lang/bug44654.phpt b/tests/lang/bug44654.phpt new file mode 100755 index 0000000000..7e7f973d9d --- /dev/null +++ b/tests/lang/bug44654.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #44654 (syntax error for #) +--FILE-- +# +# +# +--EXPECT-- +##1