diff options
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r-- | sapi/cli/php_cli.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 806cc214c2..3392fb0b22 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -550,6 +550,9 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file, *lineno = 1; + file_handle->type = ZEND_HANDLE_FP; + file_handle->opened_path = NULL; + file_handle->free_filename = 0; if (!(file_handle->handle.fp = VCWD_FOPEN(script_file, "rb"))) { php_printf("Could not open input file: %s\n", script_file); return FAILURE; @@ -1166,7 +1169,7 @@ int main(int argc, char *argv[]) case PHP_MODE_INDENT: open_file_for_scanning(&file_handle TSRMLS_CC); zend_indent(); - fclose(file_handle.handle.fp); + zend_file_handle_dtor(file_handle.handle TSRMLS_CC); goto out; break; #endif |