diff options
Diffstat (limited to 'network/elinks/patches/0005-gopher_newlines_tabs_entity.patch')
-rw-r--r-- | network/elinks/patches/0005-gopher_newlines_tabs_entity.patch | 58 |
1 files changed, 26 insertions, 32 deletions
diff --git a/network/elinks/patches/0005-gopher_newlines_tabs_entity.patch b/network/elinks/patches/0005-gopher_newlines_tabs_entity.patch index f27b655cc6..b255fb4f98 100644 --- a/network/elinks/patches/0005-gopher_newlines_tabs_entity.patch +++ b/network/elinks/patches/0005-gopher_newlines_tabs_entity.patch @@ -1,13 +1,13 @@ ##################################################################### -# Some fixes for having line feeds in text without a carriage return. +# Fix line feeds without carriage returns. # Make sure that only lines with tabs are treated as links. # Support links that don't begin with a '/'. # dave@slackbuilds.org ##################################################################### -diff -Naur a/src/protocol/gopher/gopher.c b/src/protocol/gopher/gopher.c ---- a/src/protocol/gopher/gopher.c 2020-01-08 05:43:40.148408539 +0000 -+++ b/src/protocol/gopher/gopher.c 2020-01-08 05:43:26.357005028 +0000 -@@ -322,7 +322,7 @@ +diff -Naur -x .git bb/src/protocol/gopher/gopher.c cc/src/protocol/gopher/gopher.c +--- bb/src/protocol/gopher/gopher.c 2020-01-14 03:19:39.956296190 +0000 ++++ cc/src/protocol/gopher/gopher.c 2020-01-14 03:20:05.295045232 +0000 +@@ -290,7 +290,7 @@ /* Get entity type, and selector string. */ /* Pick up gopher_entity */ @@ -16,42 +16,36 @@ diff -Naur a/src/protocol/gopher/gopher.c b/src/protocol/gopher/gopher.c entity = *selector++; selectorlen--; } -@@ -472,6 +472,7 @@ - unsigned char *host = NULL; - unsigned char *port = NULL; - enum gopher_entity entity = *name++; -+ int link = 0; - - if (!entity) { - add_char_to_string(buffer, '\n'); -@@ -481,6 +482,7 @@ - if (*name) { - selector = strchr(name, ASCII_TAB); - if (selector) { -+ link = 1; - /* Terminate name */ - *selector++ = '\0'; - -@@ -551,7 +553,7 @@ - switch (entity) { - case GOPHER_WWW: - /* Gopher pointer to W3 */ -- if (selector) { -+ if (selector && link == 1) { - add_gopher_link(buffer, name, selector); - break; +@@ -333,6 +333,18 @@ } -@@ -603,7 +605,8 @@ + } + ++ if (entity_info->type == '1') { ++ if (strchr(selector, '1') == (char *) selector) { ++ selector++; ++ selectorlen--; ++ } ++ else { ++ if ((char *) selector == "/1") { ++ selectorlen--; ++ } ++ } ++ } ++ + state = add_gopher_command(conn, &command, entity, selector, selectorlen); + if (!is_in_state(state, S_CONN)) + return state; +@@ -570,7 +582,8 @@ } else if (address.length > 0 && strlcmp(address.source, address.length - 1, - "gopher://error.host:1/", -1)) { + "gopher://error.host:1/", -1) -+ && link == 1) { ++ && selector) { add_gopher_link(buffer, name, address.source); } else { -@@ -623,7 +626,7 @@ +@@ -590,7 +603,7 @@ get_gopher_line_end(unsigned char *data, int datalen) { for (; datalen > 1; data++, datalen--) |