From 51d823832538d495f382299ec668e7afa1cc12f8 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 2 Jan 2021 11:35:53 +0200 Subject: Add support for Finger protocol A patch courtesy of John Cowan. IssueID #106 --- src/gopher.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/gopher.c') diff --git a/src/gopher.c b/src/gopher.c index dfdcf672..229ff9f4 100644 --- a/src/gopher.c +++ b/src/gopher.c @@ -149,16 +149,21 @@ void deinit_Gopher(iGopher *d) { void open_Gopher(iGopher *d, const iString *url) { iUrl parts; init_Url(&parts, url); - /* Determine Gopher item type. */ - d->type = '1'; if (!isEmpty_Range(&parts.path)) { if (*parts.path.start == '/') { parts.path.start++; } - if (parts.path.start < parts.path.end) { - d->type = *parts.path.start; - parts.path.start++; - } + } + /* Determine Gopher item type (finger is type 0). */ + if (equalCase_Rangecc(parts.scheme, "finger")) { + d->type = '0'; + } + else if (parts.path.start < parts.path.end) { + d->type = *parts.path.start; + parts.path.start++; + } + else { + d->type = '1'; } if (d->type == '7' && isEmpty_Range(&parts.query)) { /* Ask for the query parameters first. */ -- cgit v1.2.3