Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45547 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35377 invoked from network); 9 Sep 2009 21:59:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Sep 2009 21:59:37 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 63.205.162.117 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.117 us-mr1.zend.com Linux 2.4/2.6 Received: from [63.205.162.117] ([63.205.162.117:55262] helo=us-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4A/A3-38554-84528AA4 for ; Wed, 09 Sep 2009 17:59:37 -0400 Received: from us-gw1.zend.com (us-ex1.zend.net [192.168.16.5]) by us-mr1.zend.com (Postfix) with ESMTP id A61D2E11E9; Wed, 9 Sep 2009 14:46:20 -0700 (PDT) Received: from [192.168.16.82] ([192.168.16.82]) by us-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 9 Sep 2009 14:58:51 -0700 Message-ID: <4AA8251A.6010004@zend.com> Date: Wed, 09 Sep 2009 14:58:50 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Garrett Serack CC: 'PHP Internals' References: <4A9EE046.4090500@zend.com> <4AA05FCC.2000501@zend.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 09 Sep 2009 21:58:51.0043 (UTC) FILETIME=[B71D6F30:01CA3198] Subject: Re: [PHP-DEV] Fix for 49148 (combination of stream_get_line and fseek does not work correctly) From: stas@zend.com (Stanislav Malyshev) Hi! > Well, that's a really good question. > > Pre-patch, at the end of the stream (when you don't explicitly seek), > you get empty strings: I think it's a bug, docs say it's like fgets and fgets returns false on EOF. Also, "" with this function can mean "delimiter, than another delimititer" if I understand correctly, because it doesn't return the delims - which means returning "" on EOF is even worse bug. > Do you want to change the behavior so that it does return false? It's > trivial to do (and I'd agree that it would be correct), but it does > change the behavior from the current behavior. I think it's a bug and should be changed to return false on EOF, just as fgets does. Of course, if there's data before EOF it should return it, and then next read should return false. The case where file ends with delim should return data before delim on first read, and false on the next after delim was read. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com