summaryrefslogtreecommitdiff
path: root/gl/getpass.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2010-01-26 15:39:52 +0100
committerSimon Josefsson <simon@josefsson.org>2010-01-26 15:39:52 +0100
commitd8d94c27e1c30a7a09fbfa77bdfd995e2307a7f6 (patch)
tree0b1ee6da324163860b2a2ea7a23c8946a59031ac /gl/getpass.c
parentba4d206c53fdd9f6c1b19c2ae571054b5765c5f2 (diff)
downloadgnutls-d8d94c27e1c30a7a09fbfa77bdfd995e2307a7f6.tar.gz
Update gnulib files.
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)