Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45127 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38051 invoked from network); 28 Jul 2009 19:59:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jul 2009 19:59:06 -0000 Authentication-Results: pb1.pair.com header.from=chrisstocktonaz@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=chrisstocktonaz@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.204 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: chrisstocktonaz@gmail.com X-Host-Fingerprint: 209.85.216.204 mail-px0-f204.google.com Received: from [209.85.216.204] ([209.85.216.204:62449] helo=mail-px0-f204.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/C8-33017-9885F6A4 for ; Tue, 28 Jul 2009 15:59:06 -0400 Received: by pxi42 with SMTP id 42so139120pxi.29 for ; Tue, 28 Jul 2009 12:59:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=hIuJ6kow+EM3BZZ8TpaUO+ahhStjbtiNTBu3CE2K5GY=; b=Ng95PhxPIbeQPaDXK0b26xqg/3jphlZh1Bd/E/bf8X9N/fTJXCpcMx8UxQGX+w7tf9 EbuJ6AWaqCsmyRxpSove0DQVybkIMwg5JhJqObPdDcZAh0frBBAzmdP5NhDxlE/e6RkH sEf0xrkyLA1RFpjXCnyHkN+Aqqjq2rdBlcJuo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=uQd370lSqkTKUgU9RdR176EJwa9N23dW7sRRYi4APMVWAgG3R2PaiNaiMe+TRM3/Lh JEG5YgVhSZH1Z6ul1lUsSJyqqmc0R1AizIT+XVALc1ywc5H66NaDkOS4rQSSh6UcsROD 11Tmj+WUYDs76y+5Z/Xra+p8R5L26KF8R+x6g= MIME-Version: 1.0 Received: by 10.142.108.3 with SMTP id g3mr1040903wfc.49.1248811142988; Tue, 28 Jul 2009 12:59:02 -0700 (PDT) Date: Tue, 28 Jul 2009 12:59:02 -0700 Message-ID: To: PHP Developers Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: fgetcsv returns null on invalid resource From: chrisstocktonaz@gmail.com (Chris Stockton) Hello, I came across a condition in some legacy code that did not properly check if a file was a valid resource (Causes while(FALSE !=3D=3D ($data =3D fgetcsv($fp))) { to be a infinite loop). I made a small change to standard/file.c to return false instead of null as the documentation seems to state as well as make it more consistent with the file reading family. My question is, does it return null for a specific reason? If not I assume filing a bug is the route to take. The simple change I am speaking of is listed below. -Chris -- Index: ext/standard/file.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ext/standard/file.c (revision 286463) +++ ext/standard/file.c (working copy) @@ -2032,7 +2032,7 @@ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&enclosure_str, &enclosure_s= tr_len, =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&escape_str, &escape_str_len= ) =3D=3D FAILURE =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0) { - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 RETURN_FALSE; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (delimiter_str !=3D NULL) {