X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgetpass.c;h=17d513720ea020d3e11b6a6f75026ca33a328c55;hb=fa3486514bd8f15f8eb4c49821d0356b52e5a335;hp=f0b3184eeb219eef51d203ecf141f6a87b9fa1ad;hpb=222b0486b7db1b09293e05512873d633440efcb3;p=gnulib.git diff --git a/lib/getpass.c b/lib/getpass.c index f0b3184ee..17d513720 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, 2007 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. */ -#ifdef 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 @@ -38,8 +41,6 @@ # include #endif -#include "getline.h" - #if USE_UNLOCKED_IO # include "unlocked-io.h" #else @@ -139,7 +140,7 @@ getpass (const char *prompt) == fileno (out). The POSIX restrictions are tricky and change from POSIX version to POSIX version, so play it safe and invoke fseek even if in != out. */ - fseek (out, 0, SEEK_CUR); + fseeko (out, 0, SEEK_CUR); if (buf != NULL) { @@ -170,13 +171,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