mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
Fixed bug #45779 (regression with shebang lines processing)
This commit is contained in:
parent
bfb468c275
commit
05376077b3
4 changed files with 368 additions and 381 deletions
File diff suppressed because it is too large
Load diff
|
@ -848,6 +848,7 @@ yymore_restart:
|
||||||
while (++YYCURSOR < YYLIMIT) {
|
while (++YYCURSOR < YYLIMIT) {
|
||||||
if (*YYCURSOR == '\n') {
|
if (*YYCURSOR == '\n') {
|
||||||
++YYCURSOR;
|
++YYCURSOR;
|
||||||
|
CG(zend_lineno)++;
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -855,6 +856,7 @@ yymore_restart:
|
||||||
if (++YYCURSOR < YYLIMIT && *YYCURSOR == '\n') { /* match \r\n as single newline */
|
if (++YYCURSOR < YYLIMIT && *YYCURSOR == '\n') { /* match \r\n as single newline */
|
||||||
++YYCURSOR;
|
++YYCURSOR;
|
||||||
}
|
}
|
||||||
|
CG(zend_lineno)++;
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Generated by re2c 0.13.5 on Mon Jul 28 15:23:25 2008 */
|
/* Generated by re2c 0.13.5 on Tue Aug 12 20:38:47 2008 */
|
||||||
#line 3 "Zend/zend_language_scanner_defs.h"
|
#line 3 "Zend/zend_language_scanner_defs.h"
|
||||||
|
|
||||||
enum YYCONDTYPE {
|
enum YYCONDTYPE {
|
||||||
|
|
|
@ -575,23 +575,6 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file,
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
file_handle->filename = script_file;
|
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;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue