From 0ca8ea19bcd965233ac4195c285141349fc08855 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Tue, 7 Mar 2023 12:40:30 +0100 Subject: main.c: Replace + with whitespace for directories --- main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 7e917fc..7914d25 100644 --- a/main.c +++ b/main.c @@ -819,8 +819,7 @@ static int createdir(const struct http_payload *const p, return page_bad_request(r); } - char *name = NULL; - const char *dir = NULL; + char *name = NULL, *dir = NULL; for (size_t i = 0; i < n; i++) { @@ -855,10 +854,13 @@ static int createdir(const struct http_payload *const p, /* HTML input forms use '+' for whitespace, rather than %20. */ { - char *c = name; + char *c = name, *d = dir; while ((c = strchr(c, '+'))) *c = ' '; + + while ((d = strchr(d, '+'))) + *d = ' '; } const char *const root = auth_dir(a); -- cgit v1.2.3