aboutsummaryrefslogtreecommitdiffstats
path: root/ftp.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:24:02 +0000
committerTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:24:02 +0000
commitd6d37ee0c991ead2b1613c0af242d2e603313d87 (patch)
treef54ef4313b0db75941e44bf480c5b9edfa16e208 /ftp.c
parentReleasing debian version 0.5.1-5.1 (diff)
downloadw3m-d6d37ee0c991ead2b1613c0af242d2e603313d87.tar.gz
w3m-d6d37ee0c991ead2b1613c0af242d2e603313d87.zip
Releasing debian version 0.5.2-1debian/0.5.2-1
Diffstat (limited to 'ftp.c')
-rw-r--r--ftp.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/ftp.c b/ftp.c
index 0ebb930..e3f8c2e 100644
--- a/ftp.c
+++ b/ftp.c
@@ -1,6 +1,8 @@
-/* $Id: ftp.c,v 1.37 2006/04/07 13:21:11 inu Exp $ */
+/* $Id: ftp.c,v 1.39 2007/05/31 01:19:50 inu Exp $ */
#include <stdio.h>
+#ifndef __MINGW32_VERSION
#include <pwd.h>
+#endif /* __MINGW32_VERSION */
#include <Str.h>
#include <signal.h>
#include <setjmp.h>
@@ -14,10 +16,14 @@
#include <malloc.h>
#endif /* DEBUG */
+#ifndef __MINGW32_VERSION
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
+#else
+#include <winsock.h>
+#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;
}