summaryrefslogtreecommitdiff
path: root/network/elinks/patches/0006-gopher-indexes_nocr.patch
blob: 9e4a441db66cef70e0c99f8db17f8cd510774d96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#######################################################################
# Fix index listings with only LF and no CRs.
# dave@slackbuilds.org 
#######################################################################
diff -Naur '--exclude=.git' bb/src/protocol/gopher/gopher.c cc/src/protocol/gopher/gopher.c
--- bb/src/protocol/gopher/gopher.c	2020-01-14 06:42:11.030536586 +0000
+++ cc/src/protocol/gopher/gopher.c	2020-01-14 06:42:26.710000886 +0000
@@ -757,6 +757,11 @@
 	switch (gopher->entity->type) {
 	case GOPHER_DIRECTORY:
 	case GOPHER_INDEX:
+		/* Lines with no carriage returns */
+		if (strchr(rb->data, ASCII_CR) == NULL) {
+			strncat(rb->data, "\r\n", 2);
+			rb->length += 3;
+		}
 		state = read_gopher_directory_data(conn, rb);
 		break;