Subject: Re: bug#17839: 24.4.50; read-passwd echoes password input in non-interactive sessions

From: Michael Albinus <[email-masked]>
Date: Fri, 11 Jul 2014 16:57:40 +0200

Eli Zaretskii <[email-masked]> writes:

> The result is not 100% satisfactory, as one needs to press RET twice
> to finish the input, and it looks like some garbage is left in the
> input buffer, since the following (normal) input gets something
> strange.  A workaround is to press C-z, which produces EOF, instead of
> RET, when password entry is finished.

Maybe because just "\n" is sent by fprintf()? In the Windows case,
"\r\n" might be the better choice?

And maybe we must handle the case, that RET sends 2 characters, which
must be handled by a double call of getchar()?

> I also needed a change in minibuf.c to end the reading loop on CR, not
> just a newline.  If this is bad news for Posix platforms, we can make
> that code conditional on Windows.

That's OK, I've just tested.

When I've read the code of read_minibuf_noninteractive for the first
time, I've seen that just CR was used for finishing input, and I've
thought that nobody ever used this for MS Windows. This is one of the
reasons I was somehow Windows agnostic during my work.

Best regards, Michael.