lua-users home
lua-l archive

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


On Thu, Feb 20, 2014 at 8:15 PM, René Rebe <> wrote:
> This gets is a plain and simple getchar loop:

Who would bother optimizing gets? It's for toys.

> The (latest) glibc has reads the first with getchar (EOF optimization I
> guess) and the rest with a call to an internal __iogetline.

One of the reason for this I've found previously is ungetc(). You can
have a single ungot char, calling getchar first insure you can dive
into a unget unaware function.

Francisco Olarte.