summaryrefslogtreecommitdiff
path: root/gl/getpass.c
diff options
context:
space:
mode:
Diffstat (limited to 'gl/getpass.c')
-rw-r--r--gl/getpass.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/gl/getpass.c b/gl/getpass.c
index 208e21bbda..e9b4eb9b1b 100644
--- a/gl/getpass.c
+++ b/gl/getpass.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992-2001, 2003, 2004, 2005, 2006, 2007 Free Software
- Foundation, Inc.
+/* Copyright (C) 1992-2001, 2003-2007, 2009-2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -34,7 +33,7 @@
# include <stdio_ext.h>
# endif
#else
-# define __fsetlocking(stream, type) /* empty */
+# define __fsetlocking(stream, type) /* empty */
#endif
#if HAVE_TERMIOS_H
@@ -145,17 +144,17 @@ getpass (const char *prompt)
if (buf != NULL)
{
if (nread < 0)
- buf[0] = '\0';
+ buf[0] = '\0';
else if (buf[nread - 1] == '\n')
- {
- /* Remove the newline. */
- buf[nread - 1] = '\0';
- if (tty_changed)
- {
- /* Write the newline that was not echoed. */
- putc_unlocked ('\n', out);
- }
- }
+ {
+ /* Remove the newline. */
+ buf[nread - 1] = '\0';
+ if (tty_changed)
+ {
+ /* Write the newline that was not echoed. */
+ putc_unlocked ('\n', out);
+ }
+ }
}
/* Restore the original setting. */
@@ -204,20 +203,20 @@ getpass (const char *prompt)
{
c = _getch ();
if (c == '\r')
- {
- getpassbuf[i] = '\0';
- break;
- }
+ {
+ getpassbuf[i] = '\0';
+ break;
+ }
else if (i < PASS_MAX)
- {
- getpassbuf[i++] = c;
- }
+ {
+ getpassbuf[i++] = c;
+ }
if (i >= PASS_MAX)
- {
- getpassbuf[i] = '\0';
- break;
- }
+ {
+ getpassbuf[i] = '\0';
+ break;
+ }
}
if (prompt)