diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-17 11:06:45 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-17 11:06:45 +0000 |
commit | 48c6df47d0f3791c8f9b351188f6578ae84debe4 (patch) | |
tree | 0a4c86e1c36345ad975a729fab002d5efb94d1aa /url.c | |
parent | [w3m-dev 02866] (diff) | |
download | w3m-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>
Diffstat (limited to 'url.c')
-rw-r--r-- | url.c | 31 |
1 files changed, 30 insertions, 1 deletions
@@ -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 |