Parse %09 as a search string separator in initial URIs - sacc - sacc(omys), sim… | |
git clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65… | |
Log | |
Files | |
Refs | |
Tags | |
LICENSE | |
--- | |
commit 7bd48fa9930dca90e24e17b78b451b014ae287e8 | |
parent aeb6afa41ddf42eeb865079c7d218a2cbdfe2ef3 | |
Author: Quentin Rameau <[email protected]> | |
Date: Tue, 29 Oct 2019 00:02:02 +0100 | |
Parse %09 as a search string separator in initial URIs | |
Diffstat: | |
M sacc.c | 14 ++++++++------ | |
1 file changed, 8 insertions(+), 6 deletions(-) | |
--- | |
diff --git a/sacc.c b/sacc.c | |
@@ -922,12 +922,14 @@ moldentry(char *url) | |
entry->type = gopherpath[0]; | |
entry->username = entry->selector = ++gopherpath; | |
if (entry->type == '7') { | |
- for (; *p; ++p) { | |
- if (*p == '\t') { | |
- asprintf(&entry->tag, "%s", gopherpath); | |
- *p = '\0'; | |
- break; | |
- } | |
+ p = gopherpath; | |
+ if (p = strstr(p, "%09")) { | |
+ memmove(p+1, p+3, strlen(p+3)+1); | |
+ *p = '\t'; | |
+ } | |
+ if (p = strchr(p, '\t')) { | |
+ asprintf(&entry->tag, "%s", gopherpath); | |
+ *p = '\0'; | |
} | |
} | |
entry->host = host; |