diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-03-09 01:17:37 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-03-09 01:17:37 +0100 |
| commit | a4c12e7ccc11f5f15e0e81db0be2a908eab5b141 (patch) | |
| tree | c304292c86da17007789018714eb0da2032ced31 | |
| parent | ad7fb045add90c3e4b3b7abe2a20eea3d05cfb1d (diff) | |
| download | slcl-a4c12e7ccc11f5f15e0e81db0be2a908eab5b141.tar.gz | |
Translate whitespace to '+' in append_form
Otherwise, every function calling get_forms must implement this.
| -rw-r--r-- | main.c | 19 |
1 files changed, 8 insertions, 11 deletions
@@ -145,6 +145,14 @@ static struct form *append_form(struct form *forms, const char **const s, goto end; } + /* HTML input forms use '+' for whitespace, rather than %20. */ + { + char *c = f->value; + + while ((c = strchr(c, '+'))) + *c = ' '; + } + *s = end; ret = forms; @@ -818,17 +826,6 @@ static int createdir(const struct http_payload *const p, goto end; } - /* HTML input forms use '+' for whitespace, rather than %20. */ - { - char *c = name, *d = dir; - - while ((c = strchr(c, '+'))) - *c = ' '; - - while ((d = strchr(d, '+'))) - *d = ' '; - } - const char *const root = auth_dir(a); if (!root) |
