aboutsummaryrefslogtreecommitdiff
path: root/network/elinks
diff options
context:
space:
mode:
authorDavid Woodfall <dave@dawoodfall.net>2017-12-28 23:48:55 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-01-06 06:54:58 +0700
commit2ea44079300f3fdcc728306e422987bbc419a0ca (patch)
tree345831bed594114276810d2375f62a2cdceeca51 /network/elinks
parentacf4ad14e61fecba7d58f5c2bb885ad85cdbb0f9 (diff)
network/elinks: Patched to fix gopher link issues.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'network/elinks')
-rw-r--r--network/elinks/0005-gopher_newlines_tabs_entity.patch87
-rw-r--r--network/elinks/README7
-rw-r--r--network/elinks/elinks.SlackBuild5
3 files changed, 95 insertions, 4 deletions
diff --git a/network/elinks/0005-gopher_newlines_tabs_entity.patch b/network/elinks/0005-gopher_newlines_tabs_entity.patch
new file mode 100644
index 000000000000..f93b0d543140
--- /dev/null
+++ b/network/elinks/0005-gopher_newlines_tabs_entity.patch
@@ -0,0 +1,87 @@
+#####################################################################
+# Some fixes for having line feeds in text without a carriage return.
+# Make sure that only lines with tabs are treated as links.
+# Support links that don't begin with a '/'.
+#####################################################################
+diff -Naur a/src/protocol/gopher/gopher.c b/src/protocol/gopher/gopher.c
+--- a/src/protocol/gopher/gopher.c 2017-12-28 15:08:54.310546900 +0000
++++ b/src/protocol/gopher/gopher.c 2017-12-28 20:26:00.635193897 +0000
+@@ -326,7 +326,7 @@
+
+ /* Get entity type, and selector string. */
+ /* Pick up gopher_entity */
+- if (selectorlen > 1 && selector[1] == '/') {
++ if (selectorlen > 1) {
+ entity = *selector++;
+ selectorlen--;
+ }
+@@ -357,8 +357,7 @@
+ selectorlen++;
+ }
+
+- if (entity_info->type == '1')
+- {
++ if (entity_info->type == '1') {
+ if (strstr(selector, DIR) == selector)
+ {
+ *selector++;
+@@ -402,9 +401,9 @@
+ gopher->entity = entity_info;
+ gopher->commandlen = command.length;
+
+- debug_log("439 gopher->entity: ", 0);
++ debug_log("404 gopher->entity: ", 0);
+ debug_log(gopher->entity, 1);
+- debug_log("437 command.source: ", 0);
++ debug_log("406 command.source: ", 0);
+ debug_log(command.source, 1);
+ memcpy(gopher->command, command.source, command.length);
+ done_string(&command);
+@@ -486,6 +485,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');
+@@ -495,6 +495,7 @@
+ if (*name) {
+ selector = strchr(name, ASCII_TAB);
+ if (selector) {
++ link = 1;
+ /* Terminate name */
+ *selector++ = '\0';
+
+@@ -565,7 +566,7 @@
+ switch (entity) {
+ case GOPHER_WWW:
+ /* Gopher pointer to W3 */
+- if (selector) {
++ if (selector && link == 1) {
+ add_gopher_link(buffer, name, selector);
+ break;
+ }
+@@ -617,7 +618,8 @@
+
+ } else if (address.length > 0
+ && strlcmp(address.source, address.length - 1,
+- "gopher://error.host:1/", -1)) {
++ "gopher://error.host:1/", -1)
++ && link == 1) {
+ add_gopher_link(buffer, name, address.source);
+
+ } else {
+@@ -639,6 +641,12 @@
+ for (; datalen > 1; data++, datalen--)
+ if (data[0] == ASCII_CR && data[1] == ASCII_LF)
+ return data + 2;
++ else
++ if(data[0] == ASCII_CR)
++ return data + 2;
++ else
++ if(data[0] == ASCII_LF)
++ return data + 2;
+
+ return NULL;
+ }
diff --git a/network/elinks/README b/network/elinks/README
index 813161f882b2..736c32bde84c 100644
--- a/network/elinks/README
+++ b/network/elinks/README
@@ -25,9 +25,10 @@ or combine them:
NOMOUSE=1 NOGPM=1 ./elinks.SlackBuild
-This version is patched to fix the foolowing:
+This version is patched to fix the following issues:
Fix gopher URL: html links.
Fix gopher index queries.
-Fix gopher remote directory links.
-Make elinks do openssl hostname verification.
+Fix gopher directory links.
+Make elinks verify ssl hostnames.
+Fix a few more issues with gopher links.
diff --git a/network/elinks/elinks.SlackBuild b/network/elinks/elinks.SlackBuild
index 68cf7cba1499..fd6794665716 100644
--- a/network/elinks/elinks.SlackBuild
+++ b/network/elinks/elinks.SlackBuild
@@ -26,7 +26,7 @@
PRGNAM=elinks
VERSION=${VERSION:-git20131231}
-BUILD=${BUILD:-8}
+BUILD=${BUILD:-9}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -83,6 +83,9 @@ patch --verbose -p1 < $CWD/0003-gopher_directory_links.patch
# Next patch makes elinks verify ssl hostnames
patch --verbose -p1 < $CWD/0004-ssl_cert_verify.patch
+# Next patch fixes several problems for gopher links
+patch --verbose -p1 < $CWD/0005-gopher_newlines_tabs_entity.patch
+
[ -n "$NOMOUSE" ] && mouse="--disable-mouse"
[ -n "$NOGPM" ] && gpm="--without-gpm"