diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2018-03-20 23:40:45 +0000 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2018-03-20 23:40:45 +0000 |
commit | c838e830e4b14855f27dc7a166f0684af41bdd35 (patch) | |
tree | 9352e52b196c8cc8e0f5e0e3485d8241952431fc /WWW/Library/Implementation/HTGopher.c | |
parent | ecb7dae178b85d6a0459660495ee4554b2eaac92 (diff) | |
download | lynx-snapshots-c838e830e4b14855f27dc7a166f0684af41bdd35.tar.gz |
snapshot of project "lynx", label v2-8-9dev_16x
Diffstat (limited to 'WWW/Library/Implementation/HTGopher.c')
-rw-r--r-- | WWW/Library/Implementation/HTGopher.c | 18 |
1 files changed, 14 insertions, 4 deletions
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 */ |