aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-12-16 15:41:03 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-12-16 15:41:03 +0000
commitaec3cd7cc64a45d1f4892de02c9c66d7774207ae (patch)
tree561de213b01773c1a206d46c78fd35a652d5c01b
parent* NEWS: rc: preserve_timestamp (diff)
downloadw3m-aec3cd7cc64a45d1f4892de02c9c66d7774207ae.tar.gz
w3m-aec3cd7cc64a45d1f4892de02c9c66d7774207ae.zip
[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 (limited to '')
-rw-r--r--ChangeLog9
-rw-r--r--anchor.c18
-rw-r--r--main.c4
3 files changed, 23 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b74b48..186c9b8 100644
--- 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
@@ -5882,4 +5889,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.625 2002/12/15 12:37:33 ukai Exp $
+$Id: ChangeLog,v 1.626 2002/12/16 15:41:03 ukai Exp $
diff --git a/anchor.c b/anchor.c
index 3f74764..f3f1724 100644
--- a/anchor.c
+++ b/anchor.c
@@ -1,4 +1,4 @@
-/* $Id: anchor.c,v 1.14 2002/12/10 15:36:10 ukai Exp $ */
+/* $Id: anchor.c,v 1.15 2002/12/16 15:41:27 ukai Exp $ */
#include "fm.h"
#include "myctype.h"
#include "regex.h"
@@ -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
index 9eea040..613b8e4 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.169 2002/12/13 02:19:01 ukai Exp $ */
+/* $Id: main.c,v 1.170 2002/12/16 15:41:35 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -4622,7 +4622,7 @@ void
chkNMIDBuffer(Buffer *buf)
{
static char *url_like_pat[] = {
- "<[^<> ][^<> ]*@[A-z0-9\\.\\-_]+>",
+ "<[!-;=?-~]+@[A-z0-9\\.\\-_]+>",
NULL,
};
int i;