aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2018-03-20 23:40:45 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2018-03-20 23:40:45 +0000
commitc838e830e4b14855f27dc7a166f0684af41bdd35 (patch)
tree9352e52b196c8cc8e0f5e0e3485d8241952431fc
parentecb7dae178b85d6a0459660495ee4554b2eaac92 (diff)
downloadlynx-snapshots-c838e830e4b14855f27dc7a166f0684af41bdd35.tar.gz
snapshot of project "lynx", label v2-8-9dev_16x
-rw-r--r--CHANGES5
-rw-r--r--WWW/Library/Implementation/HTGopher.c18
2 files changed, 17 insertions, 6 deletions
diff --git a/CHANGES b/CHANGES
index fd57f873..073337f1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,10 @@
--- $LynxId: CHANGES,v 1.957 2018/03/20 00:22:41 tom Exp $
+-- $LynxId: CHANGES,v 1.958 2018/03/20 23:40:45 tom Exp $
===============================================================================
Changes since Lynx 2.8 release
===============================================================================
-2018-03-19 (2.8.9dev.17)
+2018-03-20 (2.8.9dev.17)
+* implement "+" item type for gopher protocol (report by James Tomasino) -TD
* add checks in options-menu in case no color-styles have been defined -TD
* add Visual Studio project files for 2010, 2012 -TD
* improve checks for strings which should not be empty -TD
diff --git a/WWW/Library/Implementation/HTGopher.c b/WWW/Library/Implementation/HTGopher.c
index 4828a785..916140e9 100644
--- a/WWW/Library/Implementation/HTGopher.c
+++ b/WWW/Library/Implementation/HTGopher.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: HTGopher.c,v 1.65 2016/11/24 16:38:54 tom Exp $
+ * $LynxId: HTGopher.c,v 1.66 2018/03/20 23:38:15 tom Exp $
*
* GOPHER ACCESS HTGopher.c
* =============
@@ -212,6 +212,7 @@ static void parse_menu(const char *arg GCC_UNUSED,
HTParentAnchor *anAnchor)
{
char gtype;
+ char this_type;
int ich;
char line[BIG];
char *name = NULL, *selector = NULL; /* Gopher menu fields */
@@ -251,6 +252,7 @@ static void parse_menu(const char *arg GCC_UNUSED,
PUTC('\n');
START(HTML_PRE);
PUTC('\n'); /* newline after HTML_PRE forces split-line */
+ this_type = GOPHER_ERROR;
while ((ich = NEXT_CHAR) != EOF) {
if (interrupted_in_htgetcharacter) {
@@ -333,7 +335,9 @@ static void parse_menu(const char *arg GCC_UNUSED,
PUTS(" ");
PUTS(name);
- } else if (port) { /* Other types need port */
+ } else if (port && /* Other types need port */
+ (gtype != GOPHER_DUPLICATE ||
+ this_type != GOPHER_ERROR)) {
char *address = 0;
const char *format = *selector ? "%s//%s@%s/" : "%s//%s/";
@@ -353,6 +357,9 @@ static void parse_menu(const char *arg GCC_UNUSED,
case GOPHER_MENU:
PUTS(" (DIR) ");
break;
+ case GOPHER_DUPLICATE:
+ PUTS(" (+++) ");
+ break;
case GOPHER_CSO:
PUTS(" (CSO) ");
break;
@@ -398,7 +405,9 @@ static void parse_menu(const char *arg GCC_UNUSED,
break;
}
- HTSprintf0(&address, "//%s/%c", host, gtype);
+ if (gtype != GOPHER_DUPLICATE)
+ this_type = gtype;
+ HTSprintf0(&address, "//%s/%c", host, this_type);
for (r = selector; *r; r++) { /* Encode selector string */
if (acceptable[UCH(*r)]) {
@@ -419,7 +428,8 @@ static void parse_menu(const char *arg GCC_UNUSED,
PUTS(name);
FREE(address);
} else { /* parse error */
- CTRACE((tfp, "HTGopher: Bad menu item.\n"));
+ CTRACE((tfp, "HTGopher: Bad menu item (type %d, port %s).\n",
+ gtype, NonNull(port)));
PUTS(line);
} /* parse error */