zygo

ncurses gopher client
Log | Files | Refs

commit 6d98b860dde70bf73df0f106c88fd6ca4718e4a7
parent 6eb540a199255cc1dae84fd4ba4598cc33cf22c6
Author: hhvn <dev@hhvn.uk>
Date:   Sun, 23 Jan 2022 00:48:22 +0000

zygo.c: handle text directly

Diffstat:
Mzygo.c | 15++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/zygo.c b/zygo.c @@ -447,7 +447,7 @@ go(Elem *e, int mhist, int notls) { if (!e) return -1; - if (dup->type != '1' && dup->type != '7' && dup->type != '+') { + if (dup->type != '0' && dup->type != '1' && dup->type != '7' && dup->type != '+') { /* call mario */ uri = elemtouri(e); arg = emalloc(strlen(plumber) + strlen(uri) + 2); @@ -531,13 +531,22 @@ go(Elem *e, int mhist, int notls) { if (strcmp(line, ".") == 0) { gotall = 1; } else { - elem = gophertoelem(dup, line); + if (dup->type == '0') { + elem = emalloc(sizeof(Elem)); + elem->type = 'i'; + elem->desc = estrdup(line); + elem->selector = NULL; + elem->server = NULL; + elem->port = NULL; + } else { + elem = gophertoelem(dup, line); + } list_append(&page, elem); elem_free(elem); } } - if (!gotall) + if (!gotall && dup->type != '0') list_append(&page, &missing); if (current && mhist)