From 6db339b3d7a391f196e7c4b725a4ed0bd00f31cf Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Wed, 4 May 2011 16:23:02 +0900 Subject: Adding upstream version 0.5.2 --- ftp.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'ftp.c') diff --git a/ftp.c b/ftp.c index e54dc3b..e3f8c2e 100644 --- a/ftp.c +++ b/ftp.c @@ -1,6 +1,8 @@ -/* $Id: ftp.c,v 1.35 2004/04/16 18:47:19 ukai Exp $ */ +/* $Id: ftp.c,v 1.39 2007/05/31 01:19:50 inu Exp $ */ #include +#ifndef __MINGW32_VERSION #include +#endif /* __MINGW32_VERSION */ #include #include #include @@ -14,10 +16,14 @@ #include #endif /* DEBUG */ +#ifndef __MINGW32_VERSION #include #include #include #include +#else +#include +#endif /* __MINGW32_VERSION */ typedef struct _FTP { char *host; @@ -371,7 +377,14 @@ openFTPStream(ParsedURL *pu, URLFile *uf) term_cbreak(); } else { +#ifndef __MINGW32_VERSION pwd = Strnew_charp((char *)getpass("Password: ")); +#else + term_raw(); + pwd = Strnew_charp(inputLine("Password: ", NULL, IN_PASSWORD)); + pwd = Str_conv_to_system(pwd); + term_cbreak(); +#endif /* __MINGW32_VERSION */ } add_auth_cookie_flag = TRUE; } @@ -380,8 +393,12 @@ openFTPStream(ParsedURL *pu, URLFile *uf) else if (ftppasswd != NULL && *ftppasswd != '\0') pass = ftppasswd; else { +#ifndef __MINGW32_VERSION struct passwd *mypw = getpwuid(getuid()); tmp = Strnew_charp(mypw ? mypw->pw_name : "anonymous"); +#else + tmp = Strnew_charp("anonymous"); +#endif /* __MINGW32_VERSION */ Strcat_char(tmp, '@'); pass = tmp->ptr; } -- cgit v1.2.3