aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-02-05 16:18:23 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-02-05 16:18:23 +0000
commit84fefac4a42e24fbd214a159870239ca0060382b (patch)
tree1f98ff033630ed57080b25ac69a25e1e103488fa
parentupdate TODO (diff)
downloadw3m-84fefac4a42e24fbd214a159870239ca0060382b.tar.gz
w3m-84fefac4a42e24fbd214a159870239ca0060382b.zip
[w3m-dev 03728] IPv6 hostname
* url.c (parseURL): rewrite IPv6 address parser From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r--ChangeLog7
-rw-r--r--url.c28
2 files changed, 15 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 5d4a128..2a3431e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-02-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
+ * [w3m-dev 03728] IPv6 hostname
+ * url.c (parseURL): rewrite IPv6 address parser
+
2003-02-04 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 03724] Re: view source, edit source
@@ -7014,4 +7019,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.735 2003/02/03 15:49:13 ukai Exp $
+$Id: ChangeLog,v 1.736 2003/02/05 16:18:23 ukai Exp $
diff --git a/url.c b/url.c
index 5ba157d..45b4a58 100644
--- a/url.c
+++ b/url.c
@@ -1,4 +1,4 @@
-/* $Id: url.c,v 1.72 2003/01/31 16:25:10 ukai Exp $ */
+/* $Id: url.c,v 1.73 2003/02/05 16:18:23 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include <sys/socket.h>
@@ -766,27 +766,17 @@ parseURL(char *url, ParsedURL *p_url, ParsedURL *current)
/* ^p is here */
analyze_url:
q = p;
- while (*p && strchr(":/@?#", *p) == NULL) {
#ifdef INET6
- if (*p == '[') { /* rfc2732 compliance */
- char *p_colon = NULL;
- do {
- p++;
- if ((p_colon == NULL) && (*p == ':'))
- p_colon = p;
- } while (*p && (IS_ALNUM(*p) || *p == ':' || *p == '.'));
- if (*p == ']') {
- p++;
- break;
- }
- else if (p_colon) {
- p = p_colon;
- break;
- }
- }
-#endif
+ if (*q == '[') { /* rfc2732,rfc2373 compliance */
p++;
+ while (IS_XDIGIT(*p) || *p == ':' || *p == '.')
+ p++;
+ if (*p != ']' || (*(p + 1) && strchr(":/?#", *(p + 1)) == NULL))
+ p = q;
}
+#endif
+ while (*p && strchr(":/@?#", *p) == NULL)
+ p++;
switch (*p) {
case ':':
/* scheme://user:pass@host or