Skip to content

Commit 0e5e2af

Browse files
committed
simplification
1 parent 845b0b4 commit 0e5e2af

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

main/fopen_wrappers.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,14 +600,14 @@ PHPAPI zend_string *php_resolve_path(const char *filename, size_t filename_lengt
600600
*/
601601
if (zend_is_executing() &&
602602
(exec_filename = zend_get_executed_filename_ex()) != NULL) {
603-
if (ZSTR_LEN(exec_filename) == 0) {
604-
return NULL;
605-
}
606603
const char *exec_fname = ZSTR_VAL(exec_filename);
607-
size_t exec_fname_length = ZSTR_LEN(exec_filename) - 1;
604+
size_t exec_fname_length = ZSTR_LEN(exec_filename);
608605

609-
while (exec_fname_length != 0 && !IS_SLASH(exec_fname[exec_fname_length])) {
606+
while (exec_fname_length > 0) {
610607
--exec_fname_length;
608+
if (IS_SLASH(exec_fname[exec_fname_length])) {
609+
break;
610+
}
611611
}
612612

613613
if (exec_fname_length > 0 &&

0 commit comments

Comments
 (0)