mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
fix for deleted files when read from, generalize refcount1 test better
This commit is contained in:
parent
36c1d32bde
commit
28d4b75d26
2 changed files with 10 additions and 3 deletions
|
@ -1597,8 +1597,13 @@ static int phar_dir_seek(php_stream *stream, off_t offset, int whence, off_t *ne
|
||||||
static size_t phar_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
|
static size_t phar_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
|
||||||
{
|
{
|
||||||
phar_entry_data *data = (phar_entry_data *)stream->abstract;
|
phar_entry_data *data = (phar_entry_data *)stream->abstract;
|
||||||
|
size_t got;
|
||||||
size_t got = php_stream_read(data->fp, buf, count);
|
|
||||||
|
if (data->internal_file->is_deleted) {
|
||||||
|
stream->eof = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
got = php_stream_read(data->fp, buf, count);
|
||||||
|
|
||||||
if (data->fp->eof) {
|
if (data->fp->eof) {
|
||||||
stream->eof = 1;
|
stream->eof = 1;
|
||||||
|
|
|
@ -39,5 +39,7 @@ include $pname . '/b/c.php';
|
||||||
extra
|
extra
|
||||||
extra
|
extra
|
||||||
|
|
||||||
Warning: include(): Failed opening 'phar://%s/b/c.php): for inclusion (include_path='%s') in %s on line 27
|
Warning: include(phar:///home/cellog/workspace/pecl/phar/tests/refcount1.phpt.phar.php/b/c.php): failed to open stream: phar error: "b/c.php" is not a file in phar "/home/cellog/workspace/pecl/phar/tests/refcount1.phpt.phar.php" in /home/cellog/workspace/pecl/phar/tests/refcount1.phpt on line %d
|
||||||
|
|
||||||
|
Warning: include(): Failed opening 'phar:///home/cellog/workspace/pecl/phar/tests/refcount1.phpt.phar.php/b/c.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/cellog/workspace/pecl/phar/tests/refcount1.phpt on line %d
|
||||||
===DONE===
|
===DONE===
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue