Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2(PHP_5_3) / zend_language_scanner.c zend_language_scanner.l

[email protected] ("Nuno Lopes")
Newsgroups php.zend-engine.cvs
Message-ID <5E1F9B7F7FEF4212968F9B52A2E1404B@pc07654>
This patch doesn't actually fix the bug, just hides it a bit..
If you include a file in php 5.2 that starts with '#!', that text is 
printed, but not in 5.3.

Nuno


----- Original Message -----
> iliaa Thu Jan  1 20:16:27 2009 UTC
>
>  Modified files:              (Branch: PHP_5_3)
>    /ZendEngine2 zend_language_scanner.l zend_language_scanner.c
>  Log:
>
>  Fixed bug #46844 (php scripts or included files with first line starting
>    with # have the 1st line missed from the output).
>
> http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_language_scanner.l?r1=1.131.2.11.2.13.2.32&r2=1.131.2.11.2.13.2.33&diff_format=u
> Index: ZendEngine2/zend_language_scanner.l
> diff -u ZendEngine2/zend_language_scanner.l:1.131.2.11.2.13.2.32 
> ZendEngine2/zend_language_scanner.l:1.131.2.11.2.13.2.33
> --- ZendEngine2/zend_language_scanner.l:1.131.2.11.2.13.2.32 Tue Nov  4 
> 15:58:51 2008
> +++ ZendEngine2/zend_language_scanner.l Thu Jan  1 20:16:24 2009
> @@ -843,8 +843,8 @@
>  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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.