commit b5ec39ef3aad5d0df1188d11219769b5a08add56
parent 70fa69bacd63f5b9611c8ed911a294f8019cfc0b
Author: ukai <ukai>
Date: Mon, 16 Dec 2002 15:41:03 +0000
[w3m-dev 03576] Re: news support
* anchor.c (_put_anchor_news): convert to document code and quote
(_put_anchor_all): convert to document code
* main.c (chkNMIDBuffer): change url_like_pat
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat:
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,10 @@
+2002-12-17 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
+ * [w3m-dev 03576] Re: news support
+ * anchor.c (_put_anchor_news): convert to document code and quote
+ (_put_anchor_all): convert to document code
+ * main.c (chkNMIDBuffer): change url_like_pat
+
2002-12-15 Fumitoshi UKAI <ukai@debian.or.jp>
* NEWS: rc: preserve_timestamp
diff --git a/anchor.c b/anchor.c
@@ -196,9 +196,11 @@ _put_anchor_news(Buffer *buf, char *p1, char *p2, int line, int pos)
p1++;
if (*(p2 - 1) == '>')
p2--;
- tmp = Strnew_size(sizeof("news:") - 1 + (p2 - p1));
- Strcat_charp_n(tmp, "news:", sizeof("news:") - 1);
- Strcat_charp_n(tmp, p1, p2 - p1);
+ tmp = Strnew_charp_n(p1, p2 - p1);
+#ifdef JP_CHARSET
+ tmp = conv_str(tmp, InnerCode, buf->document_code);
+#endif
+ tmp = Sprintf("news:%s", file_quote(tmp->ptr));
return registerHref(buf, tmp->ptr, NULL, NO_REFERER, NULL, '\0', line,
pos);
}
@@ -207,7 +209,13 @@ _put_anchor_news(Buffer *buf, char *p1, char *p2, int line, int pos)
static Anchor *
_put_anchor_all(Buffer *buf, char *p1, char *p2, int line, int pos)
{
- return registerHref(buf, allocStr(p1, p2 - p1), NULL, NO_REFERER, NULL,
+ Str tmp;
+
+ tmp = Strnew_charp_n(p1, p2 - p1);
+#ifdef JP_CHARSET
+ tmp = conv_str(tmp, InnerCode, buf->document_code);
+#endif
+ return registerHref(buf, url_quote(tmp->ptr), NULL, NO_REFERER, NULL,
'\0', line, pos);
}
diff --git a/main.c b/main.c
@@ -4622,7 +4622,7 @@ void
chkNMIDBuffer(Buffer *buf)
{
static char *url_like_pat[] = {
- "<[^<> ][^<> ]*@[A-z0-9\\.\\-_]+>",
+ "<[!-;=?-~]+@[A-z0-9\\.\\-_]+>",
NULL,
};
int i;