dmitry Wed Aug 13 06:17:15 2008 UTC Modified files: /ZendEngine2 zend_language_scanner.l zend_language_scanner_defs.h /php-src/sapi/cli php_cli.c Log: Fixed bug #45779 (regression with shebang lines processing) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_language_scanner.l?r1=1.193&r2=1.194&diff_format=u Index: ZendEngine2/zend_language_scanner.l diff -u ZendEngine2/zend_language_scanner.l:1.193 ZendEngine2/zend_language_scanner.l:1.194 --- ZendEngine2/zend_language_scanner.l:1.193 Tue Aug 12 09:39:39 2008 +++ ZendEngine2/zend_language_scanner.l Wed Aug 13 06:17:15 2008 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_language_scanner.l,v 1.193 2008/08/12 09:39:39 helly Exp $ */ +/* $Id: zend_language_scanner.l,v 1.194 2008/08/13 06:17:15 dmitry Exp $ */ #if 0 # define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c) @@ -1340,6 +1340,7 @@ while (++YYCURSOR < YYLIMIT) { if (*YYCURSOR == '\n') { ++YYCURSOR; + CG(zend_lineno)++; goto restart; } @@ -1347,6 +1348,7 @@ if (++YYCURSOR < YYLIMIT && *YYCURSOR == '\n') { /* match \r\n as single newline */ ++YYCURSOR; } + CG(zend_lineno)++; goto restart; } } http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_language_scanner_defs.h?r1=1.9&r2=1.10&diff_format=u Index: ZendEngine2/zend_language_scanner_defs.h diff -u ZendEngine2/zend_language_scanner_defs.h:1.9 ZendEngine2/zend_language_scanner_defs.h:1.10 --- ZendEngine2/zend_language_scanner_defs.h:1.9 Mon Jul 28 06:09:56 2008 +++ ZendEngine2/zend_language_scanner_defs.h Wed Aug 13 06:17:15 2008 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Mon Jul 28 15:05:16 2008 */ +/* Generated by re2c 0.13.5 on Tue Aug 12 20:42:02 2008 */ #line 3 "Zend/zend_language_scanner_defs.h" enum YYCONDTYPE { http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli.c?r1=1.194&r2=1.195&diff_format=u Index: php-src/sapi/cli/php_cli.c diff -u php-src/sapi/cli/php_cli.c:1.194 php-src/sapi/cli/php_cli.c:1.195 --- php-src/sapi/cli/php_cli.c:1.194 Wed Aug 13 00:49:59 2008 +++ php-src/sapi/cli/php_cli.c Wed Aug 13 06:17:15 2008 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_cli.c,v 1.194 2008/08/13 00:49:59 jani Exp $ */ +/* $Id: php_cli.c,v 1.195 2008/08/13 06:17:15 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -590,23 +590,6 @@ return FAILURE; } file_handle->filename = script_file; - /* #!php support */ - c = fgetc(file_handle->handle.fp); - if (c == '#') { - while (c != '\n' && c != '\r') { - c = fgetc(file_handle->handle.fp); /* skip to end of line */ - } - /* handle situations where line is terminated by \r\n */ - if (c == '\r') { - if (fgetc(file_handle->handle.fp) != '\n') { - long pos = ftell(file_handle->handle.fp); - fseek(file_handle->handle.fp, pos - 1, SEEK_SET); - } - } - *lineno = 2; - } else { - rewind(file_handle->handle.fp); - } return SUCCESS; } /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php