lua_pushstring (L, "tab_separated");
lua_pushboolean (L, rh->tab_separated);
lua_settable (L, -3);
+ lua_pushstring (L, "empty_separator");
+ lua_pushboolean (L, rh->empty_separator);
+ lua_settable (L, -3);
+ lua_set_table_index (L, "separator", rh->separator);
lua_rawseti (L, -2, i++);
/* Process next element */
cur = g_list_next (cur);
new->name = tmp;
p ++;
state = 2;
+ c = p;
}
else if (g_ascii_isspace (*p)) {
/* Not header but some garbadge */
/* We got header's name, so skip any \t or spaces */
if (*p == '\t') {
new->tab_separated = TRUE;
+ new->empty_separator = FALSE;
p ++;
}
else if (*p == ' '){
+ new->empty_separator = FALSE;
p ++;
}
else if (*p == '\n' || *p == '\r') {
/* Process folding */
state = 99;
+ l = p - c - 1;
+ if (l > 0) {
+ tmp = memory_pool_alloc (task->task_pool, l + 1);
+ rspamd_strlcpy (tmp, c, l + 1);
+ new->separator = tmp;
+ }
next_state = 3;
err_state = 5;
c = p;
}
else {
/* Process value */
+ l = p - c - 1;
+ if (l > 0) {
+ tmp = memory_pool_alloc (task->task_pool, l + 1);
+ rspamd_strlcpy (tmp, c, l + 1);
+ new->separator = tmp;
+ }
c = p;
state = 3;
}