From:             tony at marston-home dot demon dot co dot uk
Operating system: Windows 7
PHP version:      5.4.8
Package:          Filesystem function related
Bug Type:         Bug
Bug description:auto_detect_line_endings does not work with MAC files

Description:
------------
auto_detect_line_endings does not work with a CSV file containing MAC line
endings.

Test script:
---------------
File 'mac-linebreaks.csv' contains the following:

label1,label2,label3\r
1a,1b,1c\r
2a,2b,2c\r
3a,3b,3c\r
4a,4b,4c\r

Each line terminates with carriage-return only "\r".

$handle = @fopen('mac-linebreaks.csv', 'r');
ini_set('auto_detect_line_endings', true);
$first = fgets($handle);

The variable $first now contains the whole file.

Expected result:
----------------
The variable $first should contain everything up to the first
carriage-return, i.e. "label1,label2,label3"


-- 
Edit bug report at https://bugs.php.net/bug.php?id=63341&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63341&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63341&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63341&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63341&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63341&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63341&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63341&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63341&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63341&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63341&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63341&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63341&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63341&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63341&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63341&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63341&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63341&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63341&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63341&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63341&r=mysqlcfg

Reply via email to