summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReeze Xia <reeze@php.net>2015-03-03 16:29:41 +0800
committerReeze Xia <reeze@php.net>2015-03-03 16:29:41 +0800
commitbb2e62ecda3f3935a076063be66b394ac6831c09 (patch)
treea81867ce00e825981639bfdbf6cc0d9d77d0eb67
parent143cc672827cd37d5bfa8e8626e9e0393e5dc061 (diff)
parent808e562f23fcc758c5ffc9b5e2f88429af3add7f (diff)
downloadphp-git-bb2e62ecda3f3935a076063be66b394ac6831c09.tar.gz
Merge branch 'PHP-5.6'
* PHP-5.6: Improve fix for bug 67741 Conflicts: main/main.c
-rw-r--r--main/main.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/main/main.c b/main/main.c
index 4bcf6989e9..3dcba48779 100644
--- a/main/main.c
+++ b/main/main.c
@@ -2525,19 +2525,21 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file)
zend_set_timeout(INI_INT("max_execution_time"), 0);
}
- {
- /*
- 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.
- */
+ /*
+ 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.
+ */
+ if (CG(start_lineno) && prepend_file_p) {
int orig_start_lineno = CG(start_lineno);
CG(start_lineno) = 0;
- 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, NULL, 2, primary_file, append_file_p) == SUCCESS);
+ if (zend_execute_scripts(ZEND_REQUIRE, NULL, 1, prepend_file_p) == SUCCESS) {
+ CG(start_lineno) = orig_start_lineno;
+ retval = (zend_execute_scripts(ZEND_REQUIRE, NULL, 2, primary_file, append_file_p) == SUCCESS);
+ }
+ } else {
+ retval = (zend_execute_scripts(ZEND_REQUIRE, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS);
}
} zend_end_try();