if (vallen) {
MAKE_STD_ZVAL(entry);
array_init(entry);
- kdup = estrndup(key, keylen);
- add_assoc_stringl_ex(entry, kdup, keylen + 1, (char *) val, vallen, 1);
- efree(kdup);
+ if (keylen) {
+ kdup = estrndup(key, keylen);
+ add_assoc_stringl_ex(entry, kdup, keylen + 1, (char *) val, vallen, 1);
+ efree(kdup);
+ } else {
+ add_next_index_stringl(entry, (char *) val, vallen, 1);
+ }
add_next_index_zval(&tmp, entry);
} else {
add_next_index_stringl(&tmp, (char *) key, keylen, 1);
char *s, *c, *key = NULL, *val = NULL;
for(c = s = estrdup(param);;) {
+ continued:
#if 0
+ {
char *tk = NULL, *tv = NULL;
if (key) {
), *c?*c:'0', tk, tv
);
STR_FREE(tk); STR_FREE(tv);
+ }
#endif
- continued:
switch (st) {
case ST_QUOTE:
quote:
http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Unexpected character (%c) at pos %tu of %zu", *c, c-s, strlen(s));
}
if (flags & HTTP_PARAMS_ALLOW_FAILURE) {
- --c;
+ if (st == ST_KEY) {
+ if (key) {
+ keylen = c - key;
+ } else {
+ key = c;
+ }
+ } else {
+ --c;
+ }
st = ST_ADD;
goto continued;
}