diff options
author | Dave Woodfall | 2020-01-09 11:14:49 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo | 2020-01-12 02:47:52 +0100 |
commit | 9044f879a9a70226159660117c245a425a808293 (patch) | |
tree | 8ebbaa9baafe6ee3abd5ad6a07775e6447c9204e /network/elinks/patches/0003-gopher_directory_links.patch | |
parent | 7bf5d624be78d025b436312d3a1dd7a60c2b26f9 (diff) | |
download | slackbuilds-9044f879a9a70226159660117c245a425a808293.tar.gz |
network/elinks: Add gopher patch for html entities
Diffstat (limited to 'network/elinks/patches/0003-gopher_directory_links.patch')
-rw-r--r-- | network/elinks/patches/0003-gopher_directory_links.patch | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/network/elinks/patches/0003-gopher_directory_links.patch b/network/elinks/patches/0003-gopher_directory_links.patch index dc80ef3728..8c61f281bb 100644 --- a/network/elinks/patches/0003-gopher_directory_links.patch +++ b/network/elinks/patches/0003-gopher_directory_links.patch @@ -2,41 +2,34 @@ # elinks does not follow links to directories on other servers # properly. This adds a '/' before the '1' at the start of a link and # removes any trailing 1. -# dave@dawoodfall.net +# dave@slackbuilds.org ####################################################################### diff -Naur a/src/protocol/gopher/gopher.c b/src/protocol/gopher/gopher.c ---- a/src/protocol/gopher/gopher.c 2017-12-17 01:54:27.941645180 +0000 -+++ b/src/protocol/gopher/gopher.c 2017-12-17 21:52:05.072454433 +0000 -@@ -317,6 +317,9 @@ - unsigned char *URL = "hURL%3"; - unsigned char *CURI = "HURI%3"; - unsigned char *CURL = "HURL%3"; +--- a/src/protocol/gopher/gopher.c 2020-01-08 04:56:18.809169382 +0000 ++++ b/src/protocol/gopher/gopher.c 2020-01-08 04:52:43.722879240 +0000 +@@ -313,6 +313,9 @@ + unsigned char const* URL = "hURL%3"; + unsigned char const* CURI = "HURI%3"; + unsigned char const* CURL = "HURL%3"; + unsigned char *DIR = "1"; + unsigned char *SLASHDIR = "/1"; + unsigned char *SLASHPOS; int selectorlen = conn->uri->datalen; struct gopher_entity_info *entity_info; size_t size; -@@ -354,6 +357,26 @@ +@@ -350,6 +353,19 @@ selectorlen++; } -+ if (entity_info->type == '1') -+ { -+ if (strstr(selector, DIR) == selector) -+ { ++ if (entity_info->type == '1') { ++ if (strstr(selector, DIR) == selector) { + *selector++; + selectorlen--; + } -+ else -+ { ++ else { + SLASHPOS = strstr(selector, SLASHDIR); -+ if (SLASHPOS != NULL) -+ { -+ if (strlen(SLASHPOS) == 2) -+ { ++ if (SLASHPOS != NULL && strlen(SLASHPOS) == 2) { + selectorlen--; -+ } + } + } + } @@ -44,18 +37,3 @@ diff -Naur a/src/protocol/gopher/gopher.c b/src/protocol/gopher/gopher.c state = add_gopher_command(conn, &command, entity, selector, selectorlen); if (!is_in_state(state, S_CONN)) return state; -@@ -379,10 +402,10 @@ - gopher->entity = entity_info; - gopher->commandlen = command.length; - --debug_log("439 gopher->entity:", 1); --debug_log(gopher->entity, 1); --debug_log("437 command.source:", 1); --debug_log(command.source, 1); -+ debug_log("439 gopher->entity: ", 0); -+ debug_log(gopher->entity, 1); -+ debug_log("437 command.source: ", 0); -+ debug_log(command.source, 1); - memcpy(gopher->command, command.source, command.length); - done_string(&command); - |