diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-03-07 12:40:30 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-03-07 12:40:30 +0100 |
| commit | 0ca8ea19bcd965233ac4195c285141349fc08855 (patch) | |
| tree | 3aaee7dac4ffc75d6c63414c83eabeecce95cadc | |
| parent | 42c23ec1a5a90a97858e469cbc6e88e86a0c43fa (diff) | |
| download | slcl-0ca8ea19bcd965233ac4195c285141349fc08855.tar.gz | |
main.c: Replace + with whitespace for directories
| -rw-r--r-- | main.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); |
