lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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:

(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:


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