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

Re: getpass.c



Howard Chu <chu@platinum.com> writes:

|> The typical Unix behavior is that an EOF character is only recognized
|> if it is the first character in an input stream. If you type a bunch
|> of characters in response to a prompt, and type an EOF, that will not
|> terminate the input. So, you only need to check to see if the first
|> character you read is an EOF. Otherwise, the input line *must* end
|> with a newline.

This is wrong.  You can easily create a stream that generates an EOF
without a preceding newline.  No library function should ever hang because
of this, even if it is unusual.

Andreas.