Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45478 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35417 invoked from network); 3 Sep 2009 21:16:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Sep 2009 21:16:05 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.158 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 72.14.220.158 fg-out-1718.google.com Received: from [72.14.220.158] ([72.14.220.158:6543] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/AE-19451-01230AA4 for ; Thu, 03 Sep 2009 17:16:03 -0400 Received: by fg-out-1718.google.com with SMTP id d23so863621fga.11 for ; Thu, 03 Sep 2009 14:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3L87yjA2YtVceikazkZKnd+lLU3nNmMPVUzE0bfAJRU=; b=KN8C+dPMsKoIPWNda7Q5WozAnzLDFb5aLT9sigh2bm2W9NB3McDg3T1kS/o9ASag7+ OQQ7sEWrAQZ/nMwklMlqwyjFgH7HPysQttsPdtpzE2kPZeVeGnmyBXwflIxuKU1lVQ5Y dtryFeWfjlpMQl2KvJqwWg8RTO+JMyOG9HA+A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=rAWJyf9vAQjiIhN62NT9xUpr78UyQ61bsTK3+pr2DkRA5NHY5doisrdjl5zWMNxxym UlCgMclFEo6It5UKu4PIXVNZZKF/xkznfttGS1GlO2oyJoYrhxlGGQt48UGEScsbsG4y fJ0YzGwB2J/EH9gxgKBVKtRwDZna7aqZqTZQ4= MIME-Version: 1.0 Received: by 10.86.231.19 with SMTP id d19mr4175295fgh.48.1252012557343; Thu, 03 Sep 2009 14:15:57 -0700 (PDT) In-Reply-To: References: <4A9EE046.4090500@zend.com> <72e33a530909022226u319b15fbt62cdd53648f1dbd3@mail.gmail.com> <72e33a530909022229l72ffa77cx7f7b6981d08a41a1@mail.gmail.com> Date: Thu, 3 Sep 2009 23:15:57 +0200 Message-ID: To: Garrett Serack Cc: =?ISO-8859-1?Q?Hans_=C5hlin?= , "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Fix for 49148 (combination of stream_get_line and fseek does not work correctly) From: pierre.php@gmail.com (Pierre Joye) hi Garrett, As the patch looks simple I still like to have a bunch set of other tests before applying it (especially for 5.2/3). The tests should ideally use various stream backends (user, bz, etc.). Cheers, On Thu, Sep 3, 2009 at 10:38 PM, Garrett Serack wro= te: > Ah, no. That is correctly handled. (the default max line length is 8k), a= nd passing in a larger number works just fine. > > G > -----Original Message----- > From: Garrett Serack > Sent: Thursday, September 03, 2009 1:32 PM > To: Garrett Serack; Hans =C5hlin; internals@lists.php.net > Subject: RE: [PHP-DEV] Fix for 49148 (combination of stream_get_line and = fseek does not work correctly) > > Ah, I found another case... when the line length is longer than the read = buffer. I'll post again in a few minutes. > > G > > -----Original Message----- > From: Garrett Serack [mailto:garretts@microsoft.com] > Sent: Thursday, September 03, 2009 1:22 PM > To: Hans =C5hlin; internals@lists.php.net > Subject: RE: [PHP-DEV] Fix for 49148 (combination of stream_get_line and = fseek does not work correctly) > > Without the patch, That is what will you see (windows or linux). (Which i= s wrong...) > > The patch corrects the case where the stream has been fseek'd to the last= line in the file, when the last line doesn't end with a line terminator. (= where you see 'false' in the results). > > Without the patch, the code mistakenly checks for EOF *after* characters = have been read in, which is completely unnecessary (and incorrect) since th= e read operation has taken place already. > > There could be some question as to the proper behavior when the stream *i= s* at EOF, and stream_get_line is called (return NULL or empty string), but= the behavior previously was to return the empty string (keep calling strea= m_get_line and once you reach the end, you will just get empty strings). > > G > > -----Original Message----- > From: ahlin.hans@gmail.com [mailto:ahlin.hans@gmail.com] On Behalf Of Han= s =C5hlin > Sent: Wednesday, September 02, 2009 10:29 PM > To: internals@lists.php.net > Subject: [PHP-DEV] Fix for 49148 (combination of stream_get_line and fsee= k does not work correctly) > > I just ran the test on Linux 2.6.29 FC11 Apache 2.2.13 and PHP 5.2.9 > > Result: > > string 'line1' (length=3D5) > string '' (length=3D0) > string 'line1' (length=3D5) > string '' (length=3D0) > string 'line1' (length=3D5) > string 'line2' (length=3D5) > string 'line1' (length=3D5) > boolean false > string 'line1' (length=3D5) > string 'line2' (length=3D5) > string 'line1' (length=3D5) > string 'line2' (length=3D5) > > -- > MvH / Hans =C5hlin > Tel: +46761488019 > http//www.kronan-net.com/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > > --=20 Pierre http://blog.thepimp.net | http://www.libgd.org