bug-glibc
[Top][All Lists]
Advanced

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

fgets(3)


From: Ben Kohlen
Subject: fgets(3)
Date: Mon, 13 Aug 2001 14:45:46 -0700 (PDT)

Perhaps this question belongs more properly on a C
language forum - nonetheless, the behaviour I have
observed seems rather arbitrary and perhaps worthy of
a bug report:

glibc-2.2.3, linux-2.4.0-test12,
bash-2.04.0(1)-release, and gcc-2.95.3 (I hope that's
everything that could possibly matter)

anyhow, the code:

fgets(buf, 16, stdin);

seems to require 2 ^D's to return if some quantity of
text >0, but <15 is entered at the console, but
requires only 1 ^D otherwise.  I had expected that 1
^D would immediately cause the stream to be flushed
and fgets() to return (possibly even multiple times if
it were called in a loop) no matter what.  If the
behaviour I have observed is the proper behaviour for
fgets(), can anyone explain how I might get the
behaviour I was expecting?

Thanks,
Ben

PS: I'm not on the list, please CC any responses to me.

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]