From 171db89cc2a82bad906704debb0db8a9058c3e35 Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 7 Nov 2020 23:12:35 +0100 Subject: Support Gopher items search (7) and binary file (9) --- url.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'url.c') diff --git a/url.c b/url.c index ce0a53c..7368e94 100644 --- a/url.c +++ b/url.c @@ -1839,6 +1839,7 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, #ifdef USE_GOPHER case SCM_GOPHER: p = pu->file; + q = p; n = 0; while(*p == '/') { ++p; @@ -1853,6 +1854,8 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, case 's': case 'g': case 'h': + case '7': + case '9': tmp = Strnew_charp(pu->file); gophertmp = Strdup(tmp); Strdelete(tmp, n, 1); @@ -1865,6 +1868,17 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, } else { type = '\0'; } + while(*p != '\0') { + if(*p == '?') + *p = '\t'; + ++p; + } + if(pu->query != NULL) { + tmp = Strnew_charp(pu->file); + Strcat_char(tmp, '\t'); + Strcat_charp(tmp, pu->query); + pu->file = tmp->ptr; + } if (non_null(GOPHER_proxy) && !Do_not_use_proxy && pu->host != NULL && !check_no_proxy(pu->host)) { -- cgit v1.2.3 From 30f873ddb1a77aa5c508e3fe863b08cc94257ed7 Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 7 Nov 2020 23:16:41 +0100 Subject: Remove unnecessary variable assignment --- url.c | 1 - 1 file changed, 1 deletion(-) (limited to 'url.c') diff --git a/url.c b/url.c index 7368e94..1a16c30 100644 --- a/url.c +++ b/url.c @@ -1839,7 +1839,6 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, #ifdef USE_GOPHER case SCM_GOPHER: p = pu->file; - q = p; n = 0; while(*p == '/') { ++p; -- cgit v1.2.3 From ba6bed3cb1dcdef2fed0e32d686ee340c2c56077 Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 7 Nov 2020 23:30:53 +0100 Subject: Remove useless loop --- url.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'url.c') diff --git a/url.c b/url.c index 1a16c30..aef66ad 100644 --- a/url.c +++ b/url.c @@ -1867,11 +1867,6 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, } else { type = '\0'; } - while(*p != '\0') { - if(*p == '?') - *p = '\t'; - ++p; - } if(pu->query != NULL) { tmp = Strnew_charp(pu->file); Strcat_char(tmp, '\t'); -- cgit v1.2.3