diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-16 16:40:54 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-16 16:44:37 +0200 |
commit | 49bac9b77bc9cacc0f984092d226e951ae336b43 (patch) | |
tree | f705f93aa693fc5e0ea5c44231585fd41f42dd57 /ext/readline/readline_cli.c | |
parent | 46faf8f018e95de27873dbcf7c094af18c4c08e4 (diff) | |
download | php-git-49bac9b77bc9cacc0f984092d226e951ae336b43.tar.gz |
Introduce zend_stream_init_filename()
Avoid more ad-hoc initialization of zend_file_handle structures.
Diffstat (limited to 'ext/readline/readline_cli.c')
-rw-r--r-- | ext/readline/readline_cli.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c index 956386c532..c533fc2743 100644 --- a/ext/readline/readline_cli.c +++ b/ext/readline/readline_cli.c @@ -592,17 +592,9 @@ static int readline_shell_run(void) /* {{{ */ int history_lines_to_write = 0; if (PG(auto_prepend_file) && PG(auto_prepend_file)[0]) { - zend_file_handle *prepend_file_p; zend_file_handle prepend_file; - - memset(&prepend_file, 0, sizeof(prepend_file)); - prepend_file.filename = PG(auto_prepend_file); - prepend_file.opened_path = NULL; - prepend_file.free_filename = 0; - prepend_file.type = ZEND_HANDLE_FILENAME; - prepend_file_p = &prepend_file; - - zend_execute_scripts(ZEND_REQUIRE, NULL, 1, prepend_file_p); + zend_stream_init_filename(&prepend_file, PG(auto_prepend_file)); + zend_execute_scripts(ZEND_REQUIRE, NULL, 1, &prepend_file); } #ifndef PHP_WIN32 |