From 6b8ee81ce1bbd5b16acd9e216bc77e425b80ea0b Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 11 Jul 2017 21:07:31 -1000 Subject: put search query in proper place --- gopher.filter.dpi.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'gopher.filter.dpi.c') diff --git a/gopher.filter.dpi.c b/gopher.filter.dpi.c index 54a3c72..fdff619 100644 --- a/gopher.filter.dpi.c +++ b/gopher.filter.dpi.c @@ -418,15 +418,13 @@ static void render_image(int s, const char *url) { } static void fix_path(char *path) { - char *start, *end; + char *query, *start, *end; /* change form input name to query */ - start = strstr(path, "__gopher__query__="); + start = query = strstr(path, "__gopher__query__="); if (!start) return; end = start + 18; - do *start++ = *end++; - while (*end); - if (start[-1] == '?') start--; - *start = '\0'; + while ((*start++ = *end++)); + query[-1] = '\t'; } static void respond(const char *url) { -- cgit v1.2.3