Re: cvs: php-src /main/streams streams.c
| From: | Antony Dovgal | Date: | Wed, 06 Apr 2005 13:18:29 +0000 |
| Subject: | Re: cvs: php-src /main/streams streams.c | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-31257@lists.php.net to get a copy of this message | ||
On Wed, 6 Apr 2005 09:05:35 -0400
Wez Furlong <kingwez@gmail.com> wrote:
> What problem does this fix?
> EOF can be a temporary condition for network streams, depending on
> non-blocking status, and the read call is used to re-enable it. (yay
> for backward compatibility).
stream_get_line() gives a lot of garbage trying to read after EOF and segfaults with this code:
<?
$fp = fopen(dirname(__FILE__)."/test.txt", 'r');
while ($data = stream_get_line($fp, 100, "|")) {
var_dump($data);
}
?>
test.txt contents:
-------
line1 | some | another
-------
--
Wbr,
Antony Dovgal aka tony2001
antony@zend.com