commit 0fd60dd1f4f09fc5f0d2879037b46538df5668e2
parent e6f3227996454801b472913ab72e7efd258efa6e
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Tue, 22 Dec 2020 00:49:16 -0800
Ignore gopher+
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/main.c b/main.c
@@ -306,12 +306,13 @@ gph_write(const char *host, const char *port, const char *request, const char *p
int
splitrun(int argc, const char **argv, int index, char *request, command *func)
{
- char *fields[5];
+ char *fields[6];
- if (argsplit(fields, LEN(fields), request, "\t\r\n") != 4) {
- warnx("Not a valid gopher item.");
- return 1;
- }
+ if (argsplit(fields, LEN(fields), request, "\t\r\n") != 4)
+ if (fields[4] != NULL && strcmp(fields[4], "+") != 0) {
+ warnx("%d: Not a valid gopher item.", index);
+ return 1;
+ }
return func(argc, argv, index, (const char **)fields);
}