lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Thomas Dickey
Subject: Re: [Lynx-dev] [bug] invalid gopher HTML links in 2.9.0dev.3
Date: Mon, 26 Aug 2019 18:51:52 -0400
User-agent: NeoMutt/20170113 (1.7.2)

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 <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]