Bug #13938 Updated: Windows-newlines are counted twice
| From: | jeroen@php.net | Date: | Fri, 09 Nov 2001 15:37:22 +0000 |
| Subject: | Bug #13938 Updated: Windows-newlines are counted twice | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-69889@lists.php.net to get a copy of this message | ||
ID: 13938
Updated by: jeroen
Reported By: troy@leaver.com
Old Summary: Bad line numbers reported for parse errors
Status: Open
Bug Type: Scripting Engine problem
Operating System: WinNT 4.0
PHP Version: 4.0.6
New Comment:
I didn't say it wasn't a bug, I was trying to track down the problem.
Changed summary.
(the *nix php version handles winnewlines correctly)
Previous Comments:
------------------------------------------------------------------------
[2001-11-09 10:17:41] troy@leaver.com
Yes, I am using Windows, and the Windows convention is CR+LF, while I guess the Unix convention is
LF only. However, the Windows version of PHP should understand the difference, in fact version
4.0.4pl1 worked fine. I still consider this a bug. You are correct, the error in the script I was
working on earlier this morning was very close to line 919.
------------------------------------------------------------------------
[2001-11-09 10:06:46] jeroen@php.net
You don't happen to use Windows newlines (I see your OS is windows)?
Not that that _should_ matter, but it can be the source of the problem. Try to convert to unix
newlines. I notice that with (n+1)/2 you get the actual line the error is on. In the long file,
doesn't the error occur on line 919 by coincidence?
------------------------------------------------------------------------
[2001-11-09 06:33:17] troy@leaver.com
I should have said there are no EXTRA newlines. Of course there are newlines in the script :)
------------------------------------------------------------------------
[2001-11-09 06:32:18] troy@leaver.com
There are absolutely no newlines. In fact, at this very moment I am making changes to a web
application, and am getting a parse error on line 1837 of a script which has only 1148 lines.
------------------------------------------------------------------------
[2001-11-05 21:43:29] brianlmoon@php.net
Can you check your file for newlines after the %>. I can reproduce the error by putting 3 or 4
newlines at the end of the file after the closing tag. Because you are in a string, it errors when
it reaches EOF.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/?id=13938
Edit this bug report at http://bugs.php.net/?id=13938&edit=1