[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: End-of-line characters in long strings
- From: Hisham <hisham.hm@...>
- Date: Thu, 17 Jan 2008 20:32:36 -0200
Hi,
Apparently, on Linux and OSX at least, "\r" characters are cut off the
ends of lines when Lua loads .lua sources, including inside long
strings. This file contains an example:
http://www.inf.puc-rio.br/~hisham/testeol.lua
(I didn't send the file in the email to avoid the risk of mailers
processing end-of-line characters themselves and ruining the test
case. Open the file in an editor that shows non-printable characters,
such as vim -- \r will appear as ^M.)
The results I get when running that are:
12
12
12
12
I'd expect the second and fourth lines to return 13, but they don't.
Is this a bug or am I doing something wrong?
-- Hisham