Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41323 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15093 invoked from network); 22 Oct 2008 18:35:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Oct 2008 18:35:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=jmertic@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jmertic@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.182.188 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: jmertic@gmail.com X-Host-Fingerprint: 64.233.182.188 nf-out-0910.google.com Received: from [64.233.182.188] ([64.233.182.188:5998] helo=nf-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/5F-41302-A827FF84 for ; Wed, 22 Oct 2008 14:35:55 -0400 Received: by nf-out-0910.google.com with SMTP id b11so1645712nfh.13 for ; Wed, 22 Oct 2008 11:35:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type:references :x-google-sender-auth; bh=oOMEqG4+ISELAUIRWmHPgUAbQ1YGsYxPeBH8LWd2t68=; b=sEuCGioE4bylLEw7JS77GobU1dnDbv+S3IoG1RcUlLJ0HJuFvZcRgH9gBXeGVblpDL /H1Mu/JYygvyDjBVWCRSY8mJYJAhtaNn0km5c0cSTQIhUJh42z4N7R711fPm7XxWPoAJ fk6QPVIUEGaDVjQBLGWhq//1sjl947eOgiK3o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=mHkxBxcD1Iah0SOEynpdtWo4FcY+/7Zdk1cWyogszV2ijYZjuhrR0BuktQew4MjfOD IkhxYOofF5H2cJQ0RgbcIuoKBpSsgq6uFf7Ku3dwJwNfLNv2k7+h2Ore44hm2NPvkmz+ MytpoqQpl1Bx0lzR2MiNQ5XPxO85f9piXygZY= Received: by 10.210.126.5 with SMTP id y5mr6614426ebc.138.1224700549792; Wed, 22 Oct 2008 11:35:49 -0700 (PDT) Received: by 10.210.125.16 with HTTP; Wed, 22 Oct 2008 11:35:49 -0700 (PDT) Message-ID: <2a9adcf0810221135h1e6ed4ecub55318cfb26b3e7e@mail.gmail.com> Date: Wed, 22 Oct 2008 11:35:49 -0700 Sender: jmertic@gmail.com To: "Lars Strojny" Cc: internals@lists.php.net In-Reply-To: <1224696974.17075.1.camel@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_33645_4421838.1224700549790" References: <2a9adcf0810221003i70f37558ob5777b5603865cdf@mail.gmail.com> <1224696974.17075.1.camel@localhost> X-Google-Sender-Auth: 48184be4b45548bc Subject: Re: [PHP-DEV] [PATCH] Bug #46367 - fputcsv does not add the correct newline character on Windows From: jmertic@php.net ("John Mertic") ------=_Part_33645_4421838.1224700549790 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Lars, Thanks for the pointers, updated the patch and added a test. Index: file.c =================================================================== RCS file: /repository/php-src/ext/standard/file.c,v retrieving revision 1.530 diff -u -r1.530 file.c --- file.c 21 Oct 2008 22:06:48 -0000 1.530 +++ file.c 22 Oct 2008 18:21:10 -0000 @@ -2104,7 +2104,7 @@ } } - smart_str_appendc(&csvline, '\n'); + smart_str_appendc(&csvline, PHP_EOL); smart_str_0(&csvline); ret = php_stream_write(stream, csvline.c, csvline.len); John Mertic jmertic@gmail.com http://jmertic.wordpress.com "Explaining a joke is like dissecting a frog: you understand it better, but the frog dies in the process." --Mark Twain On Wed, Oct 22, 2008 at 10:36 AM, Lars Strojny wrote: > Hi John, > > > Am Mittwoch, den 22.10.2008, 10:03 -0700 schrieb John Mertic: > [...] >> Below is a patch to fix this issue; it uses the constant PHP_EOL to >> get the correct newline to use on the current platform: > > Thanks for your patch. A few things to mention, as it is your first > patch: please use "diff -ru" to create unified diffs. Also we try to > always add tests for the things we fix or create. Would you mind > creating a test for the fix you sent to make sure no regression happens > in the next n years? > > Thanks, Lars > -- > Jabber: lars@strojny.net > Weblog: http://usrportage.de > ------=_Part_33645_4421838.1224700549790--