aboutsummaryrefslogtreecommitdiff
path: root/misc/getpass.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-11-30 04:49:04 +0000
committerRoland McGrath <roland@gnu.org>1995-11-30 04:49:04 +0000
commitb2518f55c0bce9b3f32551c2a0e4addcaeac7b0f (patch)
treec0d530cc474670cb87d95f404c577ca4e6a2a25a /misc/getpass.c
parentb7843ea9ff56cd1e941abf9fab7c9c8c4e7dde69 (diff)
downloadglibc-b2518f55c0bce9b3f32551c2a0e4addcaeac7b0f.zip
glibc-b2518f55c0bce9b3f32551c2a0e4addcaeac7b0f.tar.gz
glibc-b2518f55c0bce9b3f32551c2a0e4addcaeac7b0f.tar.bz2
Wed Nov 29 12:30:50 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>cvs/libc-951130
* libio/vsnprintf.c (__vsnprintf): Define as alias. * libio/iovsscanf.c (__vsscanf): Define as alias. * asprintf.c: Remove libio adaptation code added by drepper. * dprintf.c: Likewise. * printf.c: Likewise. * scanf.c: Likewise. * snprintf.c: Likewise. * sprintf.c: Likewise. * sscanf.c: Likewise. * vprintf.c: Likewise. * stdio-common/vfscanf.c [USE_IN_LIBIO] (__vfscanf): New wrapper function. (vfscanf): Define unconditionally. * sysdeps/i386/dl-machine.h (elf_machine_rel): If SYM is null, use zero for value. * misc/getpass.c: Write a newline after reading the unechoed password.
Diffstat (limited to 'misc/getpass.c')
-rw-r--r--misc/getpass.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/misc/getpass.c b/misc/getpass.c
index ec535c1..bea2ac0 100644
--- a/misc/getpass.c
+++ b/misc/getpass.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -77,8 +77,13 @@ getpass (prompt)
if (nread < 0 && buf != NULL)
buf[0] = '\0';
else if (buf[nread - 1] == '\n')
- /* Remove the newline. */
- buf[nread - 1] = '\0';
+ {
+ /* Remove the newline. */
+ buf[nread - 1] = '\0';
+ if (echo_off)
+ /* Write the newline that was not echoed. */
+ putc ('\n', out);
+ }
/* Restore echoing. */
if (echo_off)