summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-16 16:50:22 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-16 17:07:26 +0200
commite0eca262852dba1a78afcde64a49126c81fead1a (patch)
treea23dd4d3622362459724096a5404e642b1d71db6
parent49bac9b77bc9cacc0f984092d226e951ae336b43 (diff)
downloadphp-git-e0eca262852dba1a78afcde64a49126c81fead1a.tar.gz
Drop free_filename field from zend_file_handle
free_filename was always zero.
-rw-r--r--Zend/zend_language_scanner.l3
-rw-r--r--Zend/zend_stream.c5
-rw-r--r--Zend/zend_stream.h1
-rw-r--r--ext/phar/phar.c1
-rw-r--r--main/main.c1
-rw-r--r--sapi/litespeed/lsapi_main.c2
-rw-r--r--sapi/phpdbg/phpdbg_list.c4
7 files changed, 0 insertions, 17 deletions
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 5526a0a0b3..82e884d583 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -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)
diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c
index 08a1db2583..9e81e3acab 100644
--- a/Zend/zend_stream.c
+++ b/Zend/zend_stream.c
@@ -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;
- }
}
/* }}} */
diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h
index 18b07d6b3c..a554bb884c 100644
--- a/Zend/zend_stream.h
+++ b/Zend/zend_stream.h
@@ -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()
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 6d32e2c835..8da3c364e1 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.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:
diff --git a/main/main.c b/main/main.c
index 90cf190f43..d3eae3c148 100644
--- a/main/main.c
+++ b/main/main.c
@@ -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;
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index baff98df1e..0859d4a9b3 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -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);
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index 03b4c3526e..fe612be325 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -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;
}
}