commit 7bd48fa9930dca90e24e17b78b451b014ae287e8
parent aeb6afa41ddf42eeb865079c7d218a2cbdfe2ef3
Author: Quentin Rameau <quinq@fifth.space>
Date: Tue, 29 Oct 2019 00:02:02 +0100
Parse %09 as a search string separator in initial URIs
Diffstat:
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;