]> diplodocus.org Git - nmh/blobdiff - sbr/getpass.c
new.c: Order two return statements to match comment.
[nmh] / sbr / getpass.c
index 865f231b9876fdab81e66e4d26ca1771c68a6327..12805f2fdf8e878b9b4309b99eca222eaf7402ef 100644 (file)
@@ -1,4 +1,5 @@
-/*
+/* 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.
  *
@@ -77,7 +78,7 @@ nmh_getpass(const char *prompt)
     *p++ = ch;
   *p = '\0';
 
-  if (istty) {
+  if (istty && fin != stdin) {
     (void)tcsetattr(fileno(fin), TCSANOW, &oterm);
     rewind(fout);
     (void)fputc('\n', fout);