mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-10 20:49:31 +01:00
a689188b56
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
50 lines
1.3 KiB
Diff
50 lines
1.3 KiB
Diff
diff -Naur a/src/protocol/gopher/gopher.c b/src/protocol/gopher/gopher.c
|
|
--- a/src/protocol/gopher/gopher.c 2020-01-31 16:50:36.000000000 +0000
|
|
+++ b/src/protocol/gopher/gopher.c 2020-05-14 06:21:44.523952135 +0000
|
|
@@ -283,7 +283,7 @@
|
|
|
|
/* Get entity type, and selector string. */
|
|
/* Pick up gopher_entity */
|
|
- if (selectorlen > 1 && selector[1] == '/') {
|
|
+ if (selectorlen > 1) {
|
|
entity = *selector++;
|
|
selectorlen--;
|
|
}
|
|
@@ -308,6 +308,18 @@
|
|
selectorlen--;
|
|
}
|
|
|
|
+ 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;
|
|
@@ -548,7 +560,8 @@
|
|
|
|
} else if (address.length > 0
|
|
&& strlcmp(address.source, address.length - 1,
|
|
- "gopher://error.host:1/", -1)) {
|
|
+ "gopher://error.host:1/", -1)
|
|
+ && selector) {
|
|
add_gopher_link(buffer, name, address.source);
|
|
|
|
} else {
|
|
@@ -571,7 +584,7 @@
|
|
if (data[0] == ASCII_CR && data[1] == ASCII_LF)
|
|
return data + 2;
|
|
|
|
- if (data[0] == ASCII_LF)
|
|
+ if (data[0] == ASCII_CR || data[0] == ASCII_LF)
|
|
return data + 1;
|
|
}
|
|
|