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
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.
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.
- M.
--
modernish -- harness the shell
https://github.com/modernish/modernish
diff -ur lynx2.9.0dev.3.orig/WWW/Library/Implementation/HTGopher.c
lynx2.9.0dev.3/WWW/Library/Implementation/HTGopher.c
--- lynx2.9.0dev.3.orig/WWW/Library/Implementation/HTGopher.c 2019-08-25
21:59:48.000000000 +0200
+++ lynx2.9.0dev.3/WWW/Library/Implementation/HTGopher.c 2019-08-26
17:31:42.000000000 +0200
@@ -343,8 +343,8 @@
junk = StrChr(port, TAB);
if (junk)
*junk = '\0'; /* Chop port */
- if ((port[1] == '0') && (!port[2]))
- port[0] = '\0'; /* 0 means none */
+ if (!strcmp(port, ":0") || !strcmp(port, ":70"))
+ port[0] = '\0'; /* 0 or 70 mean none */
} /* no port */
} /* host ok */
} /* selector ok */
@@ -444,10 +444,7 @@
if (gtype == GOPHER_HTML) {
valid_chars = acceptable_html;
- HTSprintf0(&address, "//%s:%s/%c",
- host,
- isEmpty(port) ? "80" : port,
- this_type);
+ HTSprintf0(&address, "//%s%s/%c/", host, port,
this_type);
if (*selector == '/')
++selector;
} else {
_______________________________________________
Lynx-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lynx-dev