]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #46844 (php scripts or included files with first line
authorIlia Alshanetsky <iliaa@php.net>
Thu, 1 Jan 2009 20:19:39 +0000 (20:19 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 1 Jan 2009 20:19:39 +0000 (20:19 +0000)
starting with # have the 1st line missed from the output).

Zend/zend_language_scanner.c
Zend/zend_language_scanner.l

index f076dfbee2d81051f51c3ab0fbbcac8c947a0a42..a58a84eb70c609abd5f084cf4c5d34bf361f9681 100644 (file)
@@ -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;
index a572d64835a472f7cd2fe4e3f4d7f0117fe3eb77..747dcbe49e298fc447ae6416768abe5f73c604cb 100644 (file)
@@ -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;