lua-users home
lua-l archive

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


Hi:


On Thu, Feb 20, 2014 at 9:10 PM, René Rebe <rene@exactcode.de> wrote:

> (BTW, I think your implementation still cannot handle embedded '0x0A's
> in lines :)
> You mean \r?
>
> Why? Do nothing to them, just like before? Whatever the system C library
> does to them we pass it along until the newline (usually \n) split from the
> C library. Nothing special on top of that, just that my patch make sure all
> the C library returns ends up in the Lua string.

I think he meant \012. Remember in C '\n' as not got to be \012, or be
in the file. The runtime must return from getc whatever the compiler
translates \n to when the operating system convention for end of line
is satisfied. You can have an operating system which stores text files
as length delimited strings and syntethises the \n. And, if I do
recall correctly, some ¿ old macintosh ? os / compilers which  used
\015 for end of line mapped \r to \012 and \n to \015. With this
convention you do not need a text / binary mode, like in unix.

> What do I miss?

\n does not ned to be \012.

Francisco Olarte.