diff options
Diffstat (limited to 'sapi/phpdbg/phpdbg_list.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_list.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index 0967e22f65..73f88d46a1 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -241,9 +241,9 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { * as it may invalidate the file handle. */ if (zend_stream_fixup(file, &bufptr, &len) == FAILURE) { if (type == ZEND_REQUIRE) { - zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file->filename); + zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, ZSTR_VAL(file->filename)); } else { - zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file->filename); + zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, ZSTR_VAL(file->filename)); } return NULL; } @@ -279,22 +279,19 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) { } zend_op_array *phpdbg_init_compile_file(zend_file_handle *file, int type) { - char *filename = (char *)(file->opened_path ? ZSTR_VAL(file->opened_path) : file->filename); + zend_string *filename = file->opened_path ? file->opened_path : file->filename; char resolved_path_buf[MAXPATHLEN]; zend_op_array *op_array; phpdbg_file_source *dataptr; - if (VCWD_REALPATH(filename, resolved_path_buf)) { - filename = resolved_path_buf; + if (VCWD_REALPATH(ZSTR_VAL(filename), resolved_path_buf)) { + filename = zend_string_init(resolved_path_buf, strlen(resolved_path_buf), 0); if (file->opened_path) { zend_string_release(file->opened_path); - file->opened_path = zend_string_init(filename, strlen(filename), 0); + file->opened_path = filename; } else { - if (file->free_filename) { - efree((char *) file->filename); - } - file->free_filename = 0; + zend_string_release(file->filename); file->filename = filename; } } |