Re: [bug] invalid gopher HTML links in 2.9.0dev.3

Thomas Dickey <[email protected]>
Newsgroups gmane.comp.web.lynx.devel
Message-ID <20190826225152.ei6ps3hfpoesxgvl@prl-debianold-64.jexium-island.net>
On Mon, Aug 26, 2019 at 05:46:33PM +0200, Martijn Dekker wrote:
> Op 26-08-19 om 15:41 schreef Martijn Dekker:
> > In lynx 2.9.0dev.3, when going to:
> > gopher://gopher.metafilter.com/1/MetaFilter
> > 
> > all links point to broken addresses like:
> > gopher://gopher.metafilter.com:70:/hMetaFilter/Bom-bom-bi-bom-bi-dum-bum-bay.html

(sorry - I misread one of Tobias' examples)

> > whereas in 2.8.9rel.1 they point to correct addresses like:
> > gopher://gopher.metafilter.com/h/MetaFilter/Bom-bom-bi-bom-bi-dum-bum-bay.html
> 
> The attached patch restores 2.8.8rel.1 behaviour for me.

This is simpler (seems to work for me):

diff -u -r1.73 WWW/Library/Implementation/HTGopher.c
--- WWW/Library/Implementation/HTGopher.c	2019/08/25 19:59:48	1.73
+++ WWW/Library/Implementation/HTGopher.c	2019/08/26 22:44:21
@@ -442,17 +442,13 @@
 		    if (gtype != GOPHER_DUPLICATE)
 			this_type = gtype;
 
+		    HTSprintf0(&address, "//%s/%c", host, this_type);
 		    if (gtype == GOPHER_HTML) {
 			valid_chars = acceptable_html;
-			HTSprintf0(&address, "//%s:%s/%c",
-				   host,
-				   isEmpty(port) ? "80" : port,
-				   this_type);
 			if (*selector == '/')
 			    ++selector;
 		    } else {
 			valid_chars = acceptable_file;
-			HTSprintf0(&address, "//%s/%c", host, this_type);
 		    }
 
 		    for (r = selector; *r; r++) {	/* Encode selector string */
 
> It might be undesirable or wrong in some way, so feel free to change or
> ignore at will.
> 
> Note that the hardcoded default port 80 was also incorrect. We're parsing
> Gopher menu links to HTML documents loaded over Gopher, so the default port
> is 70.

yes... in developing the URL-fix, I had some problem with the port (ultimately
with the leading '/' on the selector), and thought that I needed the port as
a special case.

-- 
Thomas E. Dickey <[email protected]>
https://invisible-island.net
ftp://ftp.invisible-island.net

_______________________________________________
Lynx-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lynx-dev
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQTFIEjAwHSP7iJ9R6JwI1Pg9+SO2wUCXWRihAAKCRBwI1Pg9+SO
25cvAKC5cM64yNRCiFNiCmxepLEgFhCtpQCeOT3t7LANPtNfOW0WO47EK6jU4ac=
=lwtz
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.