aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-09 01:17:37 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-09 01:17:37 +0100
commita4c12e7ccc11f5f15e0e81db0be2a908eab5b141 (patch)
treec304292c86da17007789018714eb0da2032ced31
parentad7fb045add90c3e4b3b7abe2a20eea3d05cfb1d (diff)
downloadslcl-a4c12e7ccc11f5f15e0e81db0be2a908eab5b141.tar.gz
Translate whitespace to '+' in append_form
Otherwise, every function calling get_forms must implement this.
-rw-r--r--main.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/main.c b/main.c
index 4d950cd..a6c5809 100644
--- a/main.c
+++ b/main.c
@@ -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)