php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3960 fgets() and Mac text
Submitted: 2000-03-29 13:42 UTC Modified: 2000-04-12 01:57 UTC
From: chugadie dot geo at yahoo dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0 Beta 4 Patch Level 1 OS: Linux redhat 5.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chugadie dot geo at yahoo dot com
New email:
PHP Version: OS:

 

 [2000-03-29 13:42 UTC] chugadie dot geo at yahoo dot com
fgets() does not stop when it hits a newline in a text file produced from a Mac machine.  Search and replacing all the newlines with newlines in the Mac ascii file on a PC machine alleviates this problem.  This problem did not exist in php4.0b3 as I have two systems, one with b3 and one with b4l1 and they behave differently when given a tab delimited file produced from a Mac.  Hexediting the files on a PC reveals that 0D0A represents a newline in BOTH the files.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-04-12 01:57 UTC] chugadie dot geo at yahoo dot com
even though the hex is the same, you have to read in the whole file
then split on \r for mac text.  That really should be in the docs
somewhere, not just saying that it doesn't work with mac text either.
That workaround is pretty simple I'd say.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 11:00:01 2026 UTC