sacc

sacc (saccomys): simple gopher client.
Log | Files | Refs | LICENSE

commit cdc79e9b37b3d104c7d50f7bff217c1dc5eb2f34
parent 676a1119926879e8a7d5638ecbcf8f133eda4e7c
Author: Quentin Rameau <quinq@fifth.space>
Date:   Thu, 22 Jun 2017 14:15:39 +0200

Use the raw buffer directly for text files

Diffstat:
sacc.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sacc.c b/sacc.c @@ -146,7 +146,7 @@ display(Item *item) switch (item->type) { case '0': - puts(item->target); + puts(item->raw); break; case '1': items = item->dir->items; @@ -206,6 +206,7 @@ molddiritem(char *raw) item->selector = pickfield(&raw); item->host = pickfield(&raw); item->port = pickfield(&raw); + item->raw = NULL; item->dir = NULL; items[nitems-1] = item; @@ -298,7 +299,7 @@ dig(Item *entry, Item *item) { int sock; - if (item->target) /* already in cache */ + if (item->raw) /* already in cache */ return 1; item->entry = entry; @@ -313,8 +314,6 @@ dig(Item *entry, Item *item) if (!*item->raw) /* empty read */ return 0; - if (item->type == '0') - item->target = item->raw; if (item->type == '1') item->dir = molddiritem(item->raw); return 1;