Re: [hackers] [sbase] [PATCH 2/3] find: Fix flushing input buffer with -ok
On Mon, Jun 15, 2015 at 03:27:37PM -0400, Wolfgang Corcoran-Mathe wrote:
> The original flush-stdin loop (with fgets()) hung until the user
> entered some extraneous characters for it to kill.
I don't know if it is related or not, but I'm having a similar problem
with glibc. See this code:
int
main(void)
{
getchar();
getchar();
return 0;
}
If the user writes a ctrl-d in the first getchar, then the second
getchar blocks until the user writes something else, although the
file already reached the end of file. I have tested it in NetBSD
to, and the second getchar returns automatically with EOF. I
don't know what is said in the C standard, but I think this is an
error in glibc.
Regards,
Received on Tue Jun 16 2015 - 08:59:42 CEST
This archive was generated by hypermail 2.3.0
: Thu Jun 18 2015 - 17:37:27 CEST