[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: io:lines() and \0
- From: Francisco Olarte <folarte@...>
- Date: Thu, 20 Feb 2014 21:29:50 +0100
Hi:
On Thu, Feb 20, 2014 at 8:15 PM, René Rebe <rene@exactcode.de> wrote:
> This gets is a plain and simple getchar loop:
> http://www.opensource.apple.com/source/Libc/Libc-167/stdio.subproj/gets.c
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.
- References:
- Re: io:lines() and \0, Craig Barnes
- Re: io:lines() and \0, René Rebe
- Re: io:lines() and \0, Craig Barnes
- Re: io:lines() and \0, Sean Conner
- Re: io:lines() and \0, René Rebe
- Re: io:lines() and \0, René Rebe
- Re: io:lines() and \0, Sean Conner
- Re: io:lines() and \0, Francisco Olarte
- Re: io:lines() and \0, Enrico Colombini
- Re: io:lines() and \0, Francisco Olarte
- Re: io:lines() and \0, Luiz Henrique de Figueiredo
- Re: io:lines() and \0, Francisco Olarte
- Re: io:lines() and \0, René Rebe