rspamd_cl_chunk_skipc (chunk, *p);
p ++;
}
+ else if (rspamd_cl_lex_is_comment (p[0], p[1])) {
+ if (!rspamd_cl_skip_comments (parser, err)) {
+ return FALSE;
+ }
+ p = chunk->pos;
+ }
else {
/* Invalid identifier */
rspamd_cl_set_err (chunk, RSPAMD_CL_ESYNTAX, "key must begin with a letter", err);
HASH_FIND_STR (container, nobj->key, tobj);
if (tobj != NULL) {
/* Just insert a new object as the next element */
- LL_PREPEND (tobj, nobj);
HASH_DELETE (hh, container, tobj);
+ LL_PREPEND (tobj, nobj);
}
HASH_ADD_KEYPTR (hh, container, nobj->key, strlen (nobj->key), nobj);
break;
default:
/* Skip any spaces and comments */
- if (rcl_test_character (*p, RCL_CHARACTER_WHITESPACE) ||
+ if (rcl_test_character (*p, RCL_CHARACTER_WHITESPACE_UNSAFE) ||
rspamd_cl_lex_is_comment (p[0], p[1])) {
- while (p < chunk->end && rcl_test_character (*p, RCL_CHARACTER_WHITESPACE)) {
+ while (p < chunk->end && rcl_test_character (*p, RCL_CHARACTER_WHITESPACE_UNSAFE)) {
rspamd_cl_chunk_skipc (chunk, *p);
p ++;
}
g_slice_free1 (sizeof (struct rspamd_cl_stack), stack);
}
HASH_ITER (hh, parser->macroes, macro, mtmp) {
+ g_free (macro->name);
+ HASH_DEL (parser->macroes, macro);
g_slice_free1 (sizeof (struct rspamd_cl_macro), macro);
}
LL_FOREACH_SAFE (parser->chunks, chunk, ctmp) {