From 26876fc89b09cf34e88130c2d976fa220bf52dd6 Mon Sep 17 00:00:00 2001 From: bptato Date: Wed, 21 Oct 2020 16:31:05 +0200 Subject: Moved back filetype indicator to the beginning of file names --- file.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 12f439a..358f20a 100644 --- a/file.c +++ b/file.c @@ -1712,6 +1712,8 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer, URLOption url_option; Str tmp; Str volatile page = NULL; +#ifdef USE_GOPHER +#endif #ifdef USE_M17N wc_ces charset = WC_CES_US_ASCII; #endif @@ -1959,7 +1961,10 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer, #endif /* USE_NNTP */ #ifdef USE_GOPHER else if (pu.scheme == SCM_GOPHER) { - switch (pu.file[strlen(pu.file)-1]) { + p = pu.file; + while(*p == '/') + ++p; + switch (*p) { case '0': t = "text/plain"; break; @@ -7470,10 +7475,7 @@ loadGopherDir(URLFile *uf, ParsedURL *pu, wc_ces * charset) break; } type = Strsubstr(name, 0, 1); - if(file->ptr[0] == '/') - q = Strnew_m_charp("gopher://", host->ptr, ":", port->ptr, file->ptr, type->ptr, NULL)->ptr; - else - q = Strnew_m_charp("gopher://", host->ptr, ":", port->ptr, "/", file->ptr, type->ptr, NULL)->ptr; + q = Strnew_m_charp("gopher://", host->ptr, ":", port->ptr, "/", type->ptr, file->ptr, NULL)->ptr; if(link) { if(pre) { Strcat_charp(tmp, ""); -- cgit v1.2.3