-/*
+/* getpass.c -- read a password without echo.
+ *
* Portions of this code are Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
*p++ = ch;
*p = '\0';
- if (istty) {
+ if (istty && fin != stdin) {
(void)tcsetattr(fileno(fin), TCSANOW, &oterm);
rewind(fout);
(void)fputc('\n', fout);