com php-src: Improve fix for bug 67741: main/main.c
| From: | Reeze Xia | Date: | Tue, 03 Mar 2015 08:25:43 +0000 |
| Subject: | com php-src: Improve fix for bug 67741: main/main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85162@lists.php.net to get a copy of this message | ||
Commit: 860fc3947f722bf8a14f37383368aab3eecbf5f8
Author: Reeze Xia <reeze@php.net> Tue, 3 Mar 2015 16:25:43 +0800
Parents: bb466d57ae7a630526cc17f6259669f2be693aca
Branches: PHP-5.5
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=860fc3947f722bf8a14f37383368aab3eecbf5f8
Log:
Improve fix for bug 67741
Thanks to laruence.
Bugs:
https://bugs.php.net/67741
Changed paths:
M main/main.c
Diff:
diff --git a/main/main.c b/main/main.c
index 9f7c153..5d6abe3 100644
--- a/main/main.c
+++ b/main/main.c
@@ -2508,19 +2508,21 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
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 TSRMLS_CC, 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);
+ if (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 1, prepend_file_p) == SUCCESS) {
+ CG(start_lineno) = orig_start_lineno;
+ retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 2, primary_file, append_file_p) ==
SUCCESS);
+ }
+ } else {
+ retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file,
append_file_p) == SUCCESS);
}
} zend_end_try();