mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
Drop free_filename field from zend_file_handle
free_filename was always zero.
This commit is contained in:
parent
49bac9b77b
commit
e0eca26285
@ -292,9 +292,6 @@ ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle)
|
||||
zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
|
||||
/* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */
|
||||
file_handle->opened_path = NULL;
|
||||
if (file_handle->free_filename) {
|
||||
file_handle->filename = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
ZEND_API void zend_lex_tstring(zval *zv)
|
||||
|
@ -116,7 +116,6 @@ ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle) /*
|
||||
handle->opened_path = NULL;
|
||||
handle->handle.fp = zend_fopen(filename, &handle->opened_path);
|
||||
handle->filename = filename;
|
||||
handle->free_filename = 0;
|
||||
memset(&handle->handle.stream.mmap, 0, sizeof(zend_mmap));
|
||||
|
||||
return (handle->handle.fp) ? SUCCESS : FAILURE;
|
||||
@ -261,10 +260,6 @@ ZEND_API void zend_file_handle_dtor(zend_file_handle *fh) /* {{{ */
|
||||
zend_string_release_ex(fh->opened_path, 0);
|
||||
fh->opened_path = NULL;
|
||||
}
|
||||
if (fh->free_filename && fh->filename) {
|
||||
efree((char*)fh->filename);
|
||||
fh->filename = NULL;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
@ -65,7 +65,6 @@ typedef struct _zend_file_handle {
|
||||
const char *filename;
|
||||
zend_string *opened_path;
|
||||
zend_stream_type type;
|
||||
zend_bool free_filename;
|
||||
} zend_file_handle;
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
@ -3261,7 +3261,6 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type)
|
||||
efree(f.opened_path);
|
||||
}
|
||||
f.opened_path = file_handle->opened_path;
|
||||
f.free_filename = file_handle->free_filename;
|
||||
|
||||
switch (file_handle->type) {
|
||||
case ZEND_HANDLE_STREAM:
|
||||
|
@ -1585,7 +1585,6 @@ PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *h
|
||||
if (stream) {
|
||||
handle->type = ZEND_HANDLE_STREAM;
|
||||
handle->filename = (char*)filename;
|
||||
handle->free_filename = 0;
|
||||
handle->handle.stream.handle = stream;
|
||||
handle->handle.stream.reader = (zend_stream_reader_t)_php_stream_read;
|
||||
handle->handle.stream.fsizer = php_zend_stream_fsizer;
|
||||
|
@ -1313,7 +1313,6 @@ static int cli_main( int argc, char * argv[] )
|
||||
highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini);
|
||||
} else if (source_highlight == 2) {
|
||||
file_handle.filename = *p;
|
||||
file_handle.free_filename = 0;
|
||||
file_handle.opened_path = NULL;
|
||||
ret = php_lint_script(&file_handle);
|
||||
if (ret==SUCCESS) {
|
||||
@ -1324,7 +1323,6 @@ static int cli_main( int argc, char * argv[] )
|
||||
|
||||
} else {
|
||||
file_handle.filename = *p;
|
||||
file_handle.free_filename = 0;
|
||||
file_handle.opened_path = NULL;
|
||||
|
||||
php_execute_script(&file_handle);
|
||||
|
@ -294,10 +294,6 @@ zend_op_array *phpdbg_init_compile_file(zend_file_handle *file, int type) {
|
||||
zend_string_release(file->opened_path);
|
||||
file->opened_path = zend_string_init(filename, strlen(filename), 0);
|
||||
} else {
|
||||
if (file->free_filename) {
|
||||
efree((char *) file->filename);
|
||||
}
|
||||
file->free_filename = 0;
|
||||
file->filename = filename;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user