Re: shebang skipping in 5.3.0

From: Date: Tue, 08 Sep 2009 10:56:35 +0000
Subject: Re: shebang skipping in 5.3.0
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-45519@lists.php.net to get a copy of this message
Hi, Can this snippet of shebang checking be removed for php 5.3.+, 6? Its for external FPM project. cgi_main.c: php_fopen_primary_script(&file_handle TSRMLS_CC); if (CGIG(check_shebang_line) && file_handle.handle.fp && (file_handle.handle.fp != stdin)) { /* #!php support */ c = fgetc(file_handle.handle.fp); /* <------- SEGFAULT */ if (c == '#') { while (c != '\n' && c != '\r' && c != EOF) { 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); } } CG(start_lineno) = 2; } else { rewind(file_handle.handle.fp); } } fpm_request_executing(); php_execute_script(&file_handle TSRMLS_CC); Reference: http://marc.info/?l=php-internals&m=121759090811279&w=2 Many thanks in advance, dreamcat4 dreamcat4@gmail.com

« previous php.internals (#45519) next »