aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-08-04 11:05:28 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-08-04 11:05:28 +0300
commit72dd15b1a9e55a77462ac1ae16e1dd28f304ee59 (patch)
tree75c1cb0531a77b12f3d2711e20e2849f4768b066 /src
parentcb27444929e6c820e3cbd24e249b91dc665c2e1b (diff)
downloadmagi-72dd15b1a9e55a77462ac1ae16e1dd28f304ee59.tar
magi-72dd15b1a9e55a77462ac1ae16e1dd28f304ee59.tar.xz
magi-72dd15b1a9e55a77462ac1ae16e1dd28f304ee59.zip
Fix.
Diffstat (limited to 'src')
-rw-r--r--src/cookies.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cookies.c b/src/cookies.c
index d78214e..35d876f 100644
--- a/src/cookies.c
+++ b/src/cookies.c
@@ -85,7 +85,7 @@ static int end_data(struct automata *a)
static void *state_name(struct automata *a, char c);
static void *state_pre_name(struct automata *a, char c)
{
- if (c == ' ' || c == '\t'){
+ if (c == ' ' || c == '\t') {
return state_pre_name;
} else if (32 <= c && c <= 126 && !strchr("()<>@,;:\\\"/[]?={}", c)) {
magi_str_add(&a->buf, &a->buf_len, &a->buf_size, c);
@@ -185,7 +185,10 @@ static void parse_end(enum magi_error *e, struct automata *a, state s)
} else {
*e = magi_error_cookies;
}
- } else if (s != state_post_data) {
+ } else if (s == state_post_data) {
+ magi_cookies_add(a->list, &a->cookie);
+ nullify_cookie(a);
+ } else {
*e = magi_error_cookies;
}
}