From aee1be851e73bd9c36115b010283b11dbdb1165a Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Sun, 13 Apr 2008 23:57:44 +0000 Subject: [PATCH] add fstat to 027 test. Remove phar_dir_stat, stat should not be possible on a dir handle --- ext/phar/dirstream.c | 19 +------------------ ext/phar/tests/027.phpt | 2 ++ 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index 2f68badfbd..aaca07a7cd 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -34,7 +34,7 @@ php_stream_ops phar_dir_ops = { "phar dir", phar_dir_seek, /* seek */ NULL, /* cast */ - phar_dir_stat, /* stat */ + NULL, /* stat */ NULL, /* set option */ }; @@ -135,23 +135,6 @@ static int phar_dir_flush(php_stream *stream TSRMLS_DC) /* {{{ */ } /* }}} */ -/** - * Stat a dir in a phar - */ -static int phar_dir_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) /* {{{ */ -{ - phar_entry_data *data = (phar_entry_data *)stream->abstract; - - /* If ssb is NULL then someone is misbehaving */ - if (!ssb) { - return -1; - } - - phar_dostat(data->phar, data->internal_file, ssb, 0, data->phar->alias, data->phar->alias_len TSRMLS_CC); - return 0; -} -/* }}} */ - /** * add an empty element with a char * key to a hash table, avoiding duplicates * diff --git a/ext/phar/tests/027.phpt b/ext/phar/tests/027.phpt index f3ebdb8c95..ca279ac87c 100755 --- a/ext/phar/tests/027.phpt +++ b/ext/phar/tests/027.phpt @@ -48,6 +48,7 @@ var_dump(fseek($a, -1), ftell($a)); var_dump(fseek($a, 1), ftell($a)); echo "fwrite on dir handle\n"; var_dump(fwrite($a, 'hi')); +var_dump(fstat($a)); closedir($a); ?> ===DONE=== @@ -77,4 +78,5 @@ int(0) int(1) fwrite on dir handle int(0) +bool(false) ===DONE=== -- 2.50.1