X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgetpass.c;h=5b39b6d8132836c8010b9505d57a8ded0e8e3a46;hb=8e10ce2ac4853d26744a6ac45678dd78ee5b055a;hp=cdf90ca57da89bef725fb60102722535b537b716;hpb=6bc82919a69f637e184ff3c64882eafff05bbb5c;p=gnulib.git diff --git a/lib/getpass.c b/lib/getpass.c index cdf90ca57..5b39b6d81 100644 --- a/lib/getpass.c +++ b/lib/getpass.c @@ -1,4 +1,6 @@ -/* Copyright (C) 1992-2001, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1992-2001, 2003, 2004, 2005, 2006 Free Software + Foundation, Inc. + This file is part of the GNU C Library. This program is free software; you can redistribute it and/or modify @@ -15,7 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#if HAVE_CONFIG_H +#ifndef _LIBC # include #endif @@ -23,14 +25,15 @@ #include -#if !defined WIN32 +#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) #include -#if HAVE_STDIO_EXT_H -# include -#endif -#if !HAVE___FSETLOCKING +#if HAVE_DECL___FSETLOCKING && HAVE___FSETLOCKING +# if HAVE_STDIO_EXT_H +# include +# endif +#else # define __fsetlocking(stream, type) /* empty */ #endif @@ -158,7 +161,7 @@ getpass (const char *prompt) } /* Restore the original setting. */ -#if TCSETATTR +#if HAVE_TCSETATTR if (tty_changed) tcsetattr (fileno (in), TCSAFLUSH | TCSASOFT, &s); #endif @@ -170,13 +173,17 @@ getpass (const char *prompt) return buf; } -#else /* WIN32 */ +#else /* W32 native */ /* Windows implementation by Martin Lambers , improved by Simon Josefsson. */ /* For PASS_MAX. */ #include +/* For _getch(). */ +#include +/* For strdup(). */ +#include #ifndef PASS_MAX # define PASS_MAX 512