[PATCH] Fix Gopher URI -> Selector
Felix Janda <[email protected]> Tue, 30 Apr 2013 20:19:30 +0200
| Newsgroups | gmane.comp.web.links |
|---|---|
| Message-ID | <20130430181930.GA18529@gauss> |
--cNdxnHkX5QqsyA0e
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hello,
currently elinks does not convert Gopher URIs correctly to selectors.
According to RFC4266 [1] Gopher URIs are of the form
gopher://<host>:<port>/<gopher-path>
with <gopher-path> in the simplest case of the form:
<gopher-type><selector>
Two examples:
gopher://sdf.org/1
gopher://gopher.floodgap.com/hURL:http://www.floodgap.com/
For some reason init_gopher_connection_info assumes that the first
character of <selector> is '/', which breaks the two above examples.
This has already been reported [2].
The attached patch fixes it for me.
Cheers,
Felix
[1]: https://tools.ietf.org/html/rfc4266
[2]: http://bugzilla.elinks.cz/show_bug.cgi?id=1094
--cNdxnHkX5QqsyA0e
Content-Type: text/x-patch; charset=us-ascii
Content-Disposition: attachment; filename="gopher-uri.patch"
diff --git a/src/protocol/gopher/gopher.c b/src/protocol/gopher/gopher.c
index f755d25..9b36979 100644
--- a/src/protocol/gopher/gopher.c
+++ b/src/protocol/gopher/gopher.c
@@ -283,7 +283,7 @@ init_gopher_connection_info(struct connection *conn)
/* Get entity type, and selector string. */
/* Pick up gopher_entity */
- if (selectorlen > 1 && selector[1] == '/') {
+ if (selectorlen) {
entity = *selector++;
selectorlen--;
}
--cNdxnHkX5QqsyA0e
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
elinks-dev mailing list
[email protected]
http://linuxfromscratch.org/mailman/listinfo/elinks-dev
--cNdxnHkX5QqsyA0e--