Skip to content

Commit

Permalink
simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Feb 15, 2025
1 parent 845b0b4 commit 0e5e2af
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main/fopen_wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,14 +600,14 @@ PHPAPI zend_string *php_resolve_path(const char *filename, size_t filename_lengt
*/
if (zend_is_executing() &&
(exec_filename = zend_get_executed_filename_ex()) != NULL) {
if (ZSTR_LEN(exec_filename) == 0) {
return NULL;
}
const char *exec_fname = ZSTR_VAL(exec_filename);
size_t exec_fname_length = ZSTR_LEN(exec_filename) - 1;
size_t exec_fname_length = ZSTR_LEN(exec_filename);

while (exec_fname_length != 0 && !IS_SLASH(exec_fname[exec_fname_length])) {
while (exec_fname_length > 0) {
--exec_fname_length;
if (IS_SLASH(exec_fname[exec_fname_length])) {
break;
}
}

if (exec_fname_length > 0 &&
Expand Down

0 comments on commit 0e5e2af

Please sign in to comment.