diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-02 14:18:52 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-01-02 14:18:52 +0200 |
commit | 46e17ce859a5507000629484227e3d8e68f6ad1d (patch) | |
tree | 04f7cb7ba462ab11acdf605bd6ff51441ac4cc4f /src/gopher.c | |
parent | b24dde82d9ab52634f088be9546f24de5c5aa861 (diff) | |
parent | fe4302d8cbd04d64cab96d7781285a9cf602d591 (diff) |
Merge branch 'finger' into dev
Diffstat (limited to 'src/gopher.c')
-rw-r--r-- | src/gopher.c | 17 |
1 files changed, 11 insertions, 6 deletions
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) { | |||
149 | void open_Gopher(iGopher *d, const iString *url) { | 149 | void open_Gopher(iGopher *d, const iString *url) { |
150 | iUrl parts; | 150 | iUrl parts; |
151 | init_Url(&parts, url); | 151 | init_Url(&parts, url); |
152 | /* Determine Gopher item type. */ | ||
153 | d->type = '1'; | ||
154 | if (!isEmpty_Range(&parts.path)) { | 152 | if (!isEmpty_Range(&parts.path)) { |
155 | if (*parts.path.start == '/') { | 153 | if (*parts.path.start == '/') { |
156 | parts.path.start++; | 154 | parts.path.start++; |
157 | } | 155 | } |
158 | if (parts.path.start < parts.path.end) { | 156 | } |
159 | d->type = *parts.path.start; | 157 | /* Determine Gopher item type (finger is type 0). */ |
160 | parts.path.start++; | 158 | if (equalCase_Rangecc(parts.scheme, "finger")) { |
161 | } | 159 | d->type = '0'; |
160 | } | ||
161 | else if (parts.path.start < parts.path.end) { | ||
162 | d->type = *parts.path.start; | ||
163 | parts.path.start++; | ||
164 | } | ||
165 | else { | ||
166 | d->type = '1'; | ||
162 | } | 167 | } |
163 | if (d->type == '7' && isEmpty_Range(&parts.query)) { | 168 | if (d->type == '7' && isEmpty_Range(&parts.query)) { |
164 | /* Ask for the query parameters first. */ | 169 | /* Ask for the query parameters first. */ |