aboutsummaryrefslogtreecommitdiffstats
path: root/etc.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-10-30 15:39:41 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-10-30 15:39:41 +0000
commit46e147cf1f9dd6080337bc80208f930d217e2264 (patch)
treea4ac824b2c827d9399b9bdb694ee8e43a257820a /etc.c
parent[w3m-dev 03357] tab in <pre> in <ul>,<ol>,... (diff)
downloadw3m-46e147cf1f9dd6080337bc80208f930d217e2264.tar.gz
w3m-46e147cf1f9dd6080337bc80208f930d217e2264.zip
[w3m-dev 03359] support for http://user:pass@www.url.com
* etc.c (find_auth_user_passwd): use ParsedURL for args use user and passwd if these are defined in ParsedURL * file.c (getAuthCookie): change find_auth_user_passwd() * proto.h (find_auth_user_passwd): change prototype From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to '')
-rw-r--r--etc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/etc.c b/etc.c
index a8c716d..848d23e 100644
--- a/etc.c
+++ b/etc.c
@@ -1,4 +1,4 @@
-/* $Id: etc.c,v 1.25 2002/09/28 16:30:07 ukai Exp $ */
+/* $Id: etc.c,v 1.26 2002/10/30 15:39:41 ukai Exp $ */
#include "fm.h"
#include <pwd.h>
#include "myctype.h"
@@ -891,11 +891,17 @@ find_auth_pass_entry(char *host, int port, char *file, char *realm,
}
int
-find_auth_user_passwd(char *host, int port, char *file, char *realm,
+find_auth_user_passwd(ParsedURL *pu, char *realm,
Str *uname, Str *pwd, int is_proxy)
{
struct auth_pass *ent;
- ent = find_auth_pass_entry(host, port, file, realm, is_proxy);
+
+ if (pu->user && pu->pass) {
+ *uname = Strnew_charp(pu->user);
+ *pwd = Strnew_charp(pu->pass);
+ return 1;
+ }
+ ent = find_auth_pass_entry(pu->host, pu->port, pu->file, realm, is_proxy);
if (ent) {
*uname = ent->uname;
*pwd = ent->pwd;