Hi All,

My first patch so be gentle :-).

Per the documentation for the fputcsv() function, it adds a newline to
the end of the csv string it returns. However, it is hardcoded to be
'\n' ( default for unix newline ), while Windows uses \r\n. PHP should
do this as well.

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:

Index: php-src/ext/standard/file.c
===================================================================
RCS file: /repository/php-src/ext/standard/file.c,v
retrieving revision 1.530
diff -r1.530 file.c
2107c2107
<       smart_str_appendc(&csvline, '\n');
---
>       smart_str_appendc(&csvline, PHP_EOL);


John Mertic
[EMAIL PROTECTED]
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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to