aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-01-17 11:06:45 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-01-17 11:06:45 +0000
commit48c6df47d0f3791c8f9b351188f6578ae84debe4 (patch)
tree0a4c86e1c36345ad975a729fab002d5efb94d1aa
parent[w3m-dev 02866] (diff)
downloadw3m-48c6df47d0f3791c8f9b351188f6578ae84debe4.tar.gz
w3m-48c6df47d0f3791c8f9b351188f6578ae84debe4.zip
[w3m-dev 02867] mark URL for external URIs
* main.c (chkURLBuffer): chkExternalURIBuffer() * proto.h (chkExternalURIBuffer): added * url.c (chkExternalURIBuffer): added From: Fumitoshi UKAI <ukai@debian.or.jp>
-rw-r--r--ChangeLog9
-rw-r--r--main.c5
-rw-r--r--proto.h3
-rw-r--r--url.c31
4 files changed, 44 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 9277804..569d884 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-01-17 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * [w3m-dev 02867] mark URL for external URIs
+ * main.c (chkURLBuffer): chkExternalURIBuffer()
+ * proto.h (chkExternalURIBuffer): added
+ * url.c (chkExternalURIBuffer): added
+
2002-01-17 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 02866]
@@ -2098,4 +2105,4 @@
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.238 2002/01/17 10:29:14 ukai Exp $
+$Id: ChangeLog,v 1.239 2002/01/17 11:06:45 ukai Exp $
diff --git a/main.c b/main.c
index e0ee67e..882d65f 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.64 2002/01/16 19:05:37 ukai Exp $ */
+/* $Id: main.c,v 1.65 2002/01/17 11:06:45 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -4201,6 +4201,9 @@ chkURLBuffer(Buffer *buf)
NULL
};
int i;
+#ifdef USE_EXTERNAL_URI_LOADER
+ chkExternalURIBuffer(buf);
+#endif
for (i = 0; url_like_pat[i]; i++) {
reAnchor(buf, url_like_pat[i]);
}
diff --git a/proto.h b/proto.h
index 8722927..cf0627c 100644
--- a/proto.h
+++ b/proto.h
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.26 2002/01/16 16:49:54 ukai Exp $ */
+/* $Id: proto.h,v 1.27 2002/01/17 11:06:45 ukai Exp $ */
/*
* This file was automatically generated by version 1.7 of cextract.
* Manual editing not recommended.
@@ -113,6 +113,7 @@ extern char *filename_extension(char *patch, int is_url);
#ifdef USE_EXTERNAL_URI_LOADER
extern void initURIMethods();
extern Str searchURIMethods(ParsedURL *pu);
+extern void chkExternalURIBuffer(Buffer *buf);
#endif
extern void examineFile(char *path, URLFile *uf);
extern char *acceptableEncoding();
diff --git a/url.c b/url.c
index 5913adc..e9fecd5 100644
--- a/url.c
+++ b/url.c
@@ -1,4 +1,4 @@
-/* $Id: url.c,v 1.34 2002/01/15 03:45:02 ukai Exp $ */
+/* $Id: url.c,v 1.35 2002/01/17 11:06:45 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include <sys/socket.h>
@@ -2068,4 +2068,33 @@ searchURIMethods(ParsedURL *pu)
}
return NULL;
}
+
+/*
+ * RFC2396: Uniform Resource Identifiers (URI): Generic Syntax
+ * Appendix A. Collected BNF for URI
+ * uric = reserved | unreserved | escaped
+ * reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
+ * "$" | ","
+ * unreserved = alphanum | mark
+ * mark = "-" | "_" | "." | "!" | "~" | "*" | "'" |
+ * "(" | ")"
+ * escaped = "%" hex hex
+ */
+
+#define URI_PATTERN "[-;/?:@&=+$,a-zA-Z0-9_.!~*'()%]*"
+void
+chkExternalURIBuffer(Buffer *buf)
+{
+ int i;
+ struct table2 *ump;
+
+ for (i = 0; (ump = urimethods[i]) != NULL; i++) {
+ for (; ump->item1 != NULL; ump++) {
+ reAnchor(buf, Sprintf("%s:" URI_PATTERN, ump->item1)->ptr);
+ }
+ }
+ for (ump = default_urimethods; ump->item1 != NULL; ump++) {
+ reAnchor(buf, Sprintf("%s:" URI_PATTERN, ump->item1)->ptr);
+ }
+}
#endif