Bug #16521: file() - incorrect behavior (line endings ignored) on files with Mac EOLN (CR)
| From: | dphelan at bcps dot org | Date: | Wed, 10 Apr 2002 03:14:00 +0000 |
| Subject: | Bug #16521: file() - incorrect behavior (line endings ignored) on files with Mac EOLN (CR) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-4497@lists.php.net to get a copy of this message | ||
From: dphelan@bcps.org
Operating system: FreeBSD 4.5-Stable
PHP version: 4.1.2
PHP Bug Type: Filesystem function related
Bug description: file() - incorrect behavior (line endings ignored) on files with Mac EOLN (CR)
In PHP 4.1.2 (and 4.2.0-dev) Calling file() on a 4-line
text file with Macintosh line endings (CR) results in a
1-element array:
file: (file.txt)
blah
test
three
four
Code:
$array = file( 'file.txt. );
echo count( $array );
>> Returns '1' (Verified by print_r)
file() is ignoring the line endings, but the correct result
happens for files with Windows (CRLF) and Unix (LF) line
endings.
--
Edit bug report at http://bugs.php.net/?id=16521&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=16521&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=16521&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=16521&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=16521&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16521&r=support
Expected behavior: http://bugs.php.net/fix.php?id=16521&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=16521&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=16521&r=submittedtwice