This is the mail archive of the
cygwin
mailing list for the Cygwin project.
getpass and /dev/tty
- From: Denis Excoffier <cygwin at Denis-Excoffier dot org>
- To: cygwin at cygwin dot com
- Date: Wed, 4 Apr 2012 08:23:05 +0200
- Subject: getpass and /dev/tty
Hello!
Would it be possible that getpass() first reads on /dev/tty before
defaulting to stdin?
% uname -a
CYGWIN_NT-5.1 edited 1.7.12(0.260/5/3) 2012-04-03 10:24 i686 Cygwin
% ls /dev/tt*
/dev/tty /dev/ttyS0 /dev/ttyS2 /dev/ttyS3
% cat foo.c
#include <stdio.h>
#include <unistd.h>
int main () {
fprintf (stderr, "Press <Return> to continue . . .\n");
getpass ("");
return 0;
};
% gcc -O -o ./foo foo.c
% ./foo
Press <Return> to continue . . .
[here you press Return]
% ./foo < /dev/null
Press <Return> to continue . . .
%
[for the second run of ./foo, you cannot press Return]
Regards,
Denis Excoffier.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple