diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-07-21 15:11:47 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-07-21 15:11:47 +0300 |
commit | 7fbe7a4b5bbdde7244195894542e211f4385ea3a (patch) | |
tree | a0498b9a659a0879a81857b79bf9047cf08ceef8 /src/gopher.c | |
parent | 37b331ce1b72969c13d1924064c578db999c4b4a (diff) |
Gopher: Don't skip unknown line types
IssueID #317
Diffstat (limited to 'src/gopher.c')
-rw-r--r-- | src/gopher.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gopher.c b/src/gopher.c index d12745ec..914f57ba 100644 --- a/src/gopher.c +++ b/src/gopher.c | |||
@@ -158,15 +158,22 @@ static iBool convertSource_Gopher_(iGopher *d) { | |||
158 | if (startsWith_Rangecc(path, "URL:")) { | 158 | if (startsWith_Rangecc(path, "URL:")) { |
159 | format_String(buf, | 159 | format_String(buf, |
160 | "=> %s %s\n", | 160 | "=> %s %s\n", |
161 | cstr_Rangecc((iRangecc){ path.start + 4, path.end }), | 161 | cstr_String(withSpacesEncoded_String(collectNewRange_String |
162 | ((iRangecc){ path.start + 4, path.end }))), | ||
162 | cstr_Rangecc(text)); | 163 | cstr_Rangecc(text)); |
163 | } | 164 | } |
164 | appendData_Block(d->output, constBegin_String(buf), size_String(buf)); | 165 | appendData_Block(d->output, constBegin_String(buf), size_String(buf)); |
165 | iEndCollect(); | 166 | iEndCollect(); |
166 | break; | 167 | break; |
167 | } | 168 | } |
168 | default: | 169 | default: /* all unknown types */ |
169 | break; /* Ignore unknown types. */ | 170 | setPre_Gopher_(d, iFalse); |
171 | appendData_Block(d->output, text.start, size_Range(&text)); | ||
172 | appendCStr_Block(d->output, "\n"); | ||
173 | setPre_Gopher_(d, iTrue); | ||
174 | appendData_Block(d->output, path.start, port.end - path.start); | ||
175 | appendCStr_Block(d->output, "\n"); | ||
176 | break; | ||
170 | } | 177 | } |
171 | delete_String(buf); | 178 | delete_String(buf); |
172 | } | 179 | } |