aboutsummaryrefslogtreecommitdiff
path: root/gopher.filter.dpi.c
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-07-11 21:07:31 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-07-11 21:07:31 -1000
commit6b8ee81ce1bbd5b16acd9e216bc77e425b80ea0b (patch)
tree84dfaffd547f963f5044ff7eeba9cf28c6f9260a /gopher.filter.dpi.c
parentc4faf17e9c4f2d13c99eb5d983ddf320e314a4ea (diff)
put search query in proper place
Diffstat (limited to 'gopher.filter.dpi.c')
-rw-r--r--gopher.filter.dpi.c10
1 files changed, 4 insertions, 6 deletions
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) {