Skip to content

Commit bb2e62e

Browse files
committed
Merge branch 'PHP-5.6'
* PHP-5.6: Improve fix for bug 67741 Conflicts: main/main.c
2 parents 143cc67 + 808e562 commit bb2e62e

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

main/main.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,19 +2525,21 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file)
25252525
zend_set_timeout(INI_INT("max_execution_time"), 0);
25262526
}
25272527

2528-
{
2529-
/*
2530-
If cli primary file has shabang line and there is a prepend file,
2531-
the `start_lineno` will be used by prepend file but not primary file,
2532-
save it and restore after prepend file been executed.
2533-
*/
2528+
/*
2529+
If cli primary file has shabang line and there is a prepend file,
2530+
the `start_lineno` will be used by prepend file but not primary file,
2531+
save it and restore after prepend file been executed.
2532+
*/
2533+
if (CG(start_lineno) && prepend_file_p) {
25342534
int orig_start_lineno = CG(start_lineno);
25352535

25362536
CG(start_lineno) = 0;
2537-
retval = (zend_execute_scripts(ZEND_REQUIRE, NULL, 1, prepend_file_p) == SUCCESS);
2538-
CG(start_lineno) = orig_start_lineno;
2539-
2540-
retval = retval && (zend_execute_scripts(ZEND_REQUIRE, NULL, 2, primary_file, append_file_p) == SUCCESS);
2537+
if (zend_execute_scripts(ZEND_REQUIRE, NULL, 1, prepend_file_p) == SUCCESS) {
2538+
CG(start_lineno) = orig_start_lineno;
2539+
retval = (zend_execute_scripts(ZEND_REQUIRE, NULL, 2, primary_file, append_file_p) == SUCCESS);
2540+
}
2541+
} else {
2542+
retval = (zend_execute_scripts(ZEND_REQUIRE, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS);
25412543
}
25422544
} zend_end_try();
25432545

0 commit comments

Comments
 (0)