From: Ilia Alshanetsky Date: Thu, 1 Jan 2009 20:19:39 +0000 (+0000) Subject: MFB: Fixed bug #46844 (php scripts or included files with first line X-Git-Tag: php-5.4.0alpha1~191^2~4681 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f652fe101629a374d331d192391e560ade549538;p=php MFB: Fixed bug #46844 (php scripts or included files with first line starting with # have the 1st line missed from the output). --- diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c index f076dfbee2..a58a84eb70 100644 --- a/Zend/zend_language_scanner.c +++ b/Zend/zend_language_scanner.c @@ -1338,8 +1338,8 @@ yymore_restart: return 0; } - /* ignore first line when it's started with a # */ - if (YYCURSOR == SCNG(yy_start) && *YYCURSOR == '#') { + /* ignore first line when it's started with a #! */ + if (YYCURSOR == SCNG(yy_start) && *YYCURSOR == '#' && *(YYCURSOR + 1) == '!') { while (++YYCURSOR < YYLIMIT) { if (*YYCURSOR == '\n') { ++YYCURSOR; diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index a572d64835..747dcbe49e 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -1336,8 +1336,8 @@ yymore_restart: return 0; } - /* ignore first line when it's started with a # */ - if (YYCURSOR == SCNG(yy_start) && *YYCURSOR == '#') { + /* ignore first line when it's started with a #! */ + if (YYCURSOR == SCNG(yy_start) && *YYCURSOR == '#' && *(YYCURSOR + 1) == '!') { while (++YYCURSOR < YYLIMIT) { if (*YYCURSOR == '\n') { ++YYCURSOR;