com php-src: Merge branch 'PHP-5.6': main/main.c

From: Date: Tue, 03 Mar 2015 03:44:52 +0000
Subject: com php-src: Merge branch 'PHP-5.6': main/main.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85150@lists.php.net to get a copy of this message
Commit: c6e415aeb2deb733636b9f181361ad4728971197 Author: Reeze Xia <reeze@php.net> Tue, 3 Mar 2015 11:44:52 +0800 Parents: fa2450c5f817730a8c7016a88fe9dd02b09524e1 4e2c87edb34c4f151da6899d523c93b8e8565975 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c6e415aeb2deb733636b9f181361ad4728971197 Log: Merge branch 'PHP-5.6' * PHP-5.6: Fixed bug #67741 (auto_prepend_file messes up __LINE__) Conflicts: main/main.c Bugs: https://bugs.php.net/67741 Changed paths: MM main/main.c Diff: diff --cc main/main.c index f74190c,8a2c48d..4bcf698 --- a/main/main.c +++ b/main/main.c @@@ -2524,8 -2579,21 +2524,21 @@@ PHPAPI int php_execute_script(zend_file #endif zend_set_timeout(INI_INT("max_execution_time"), 0); } - retval = (zend_execute_scripts(ZEND_REQUIRE, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS); + { + /* + If cli primary file has shabang line and there is a prepend file, + the start_lineno will be used by prepend file but not primary file, + save it and restore after prepend file been executed. + */ + int orig_start_lineno = CG(start_lineno); + + CG(start_lineno) = 0; - retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, prepend_file_p) == SUCCESS); ++ retval = (zend_execute_scripts(ZEND_REQUIRE, NULL, 1, prepend_file_p) == SUCCESS); + CG(start_lineno) = orig_start_lineno; + - retval = retval && (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 2, primary_file, append_file_p) == SUCCESS); ++ retval = retval && (zend_execute_scripts(ZEND_REQUIRE, NULL, 2, primary_file, append_file_p) == SUCCESS); + } } zend_end_try(); #if HAVE_BROKEN_GETCWD

« previous php.cvs (#85150) next »