diff options
author | wrmr | 2024-11-09 01:57:10 -0500 |
---|---|---|
committer | wrmr | 2024-11-09 01:57:10 -0500 |
commit | 12d5d0df5c4b958bbb5cc339a9e556c50136a974 (patch) | |
tree | 02d07576859f0a3b7197886d5d7c224a5693cb76 /parse.c | |
parent | cbb9f606333774f4de6f639891cd1411419ecf2a (diff) |
fix gophermaps not terminating on final .
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/parse.c b/parse.c index 8ea90f8..40f7a25 100644 --- a/parse.c +++ b/parse.c @@ -48,6 +48,7 @@ size_t scatss(char *buf, size_t i, size_t n, strv_t ss) { } int parse_gophermap_line(struct doc *d, strv_t ln) { + if (ln.n == 1 && ln.s[0] == '.') return 1; char url[512] = "gopher://"; size_t urln = 9; struct { @@ -63,8 +64,6 @@ int parse_gophermap_line(struct doc *d, strv_t ln) { strv_split(&ln, '\t', &bits.host); strv_split(&ln, '\t', &bits.port); switch (bits.item_type) { - case '.': - if (ln.n == 1) return 1; default: urln = scatss(url, urln, sizeof url, bits.host); if (urln < sizeof url) url[urln++] = ':'; |