aboutsummaryrefslogtreecommitdiffstats
path: root/src/ucl
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-10-26 22:40:03 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-10-26 22:40:03 +0100
commitdac24787dff6273cc2b6c1584cb255f6b24a0238 (patch)
tree37ccc5d567f222ed63dcf696b7278f73c7f8feb2 /src/ucl
parent47f9952f1a0580585feb1204976f21deb53a338e (diff)
downloadrspamd-dac24787dff6273cc2b6c1584cb255f6b24a0238.tar.gz
rspamd-dac24787dff6273cc2b6c1584cb255f6b24a0238.zip
Update from libucl.
Diffstat (limited to 'src/ucl')
-rw-r--r--src/ucl/include/ucl.h2
-rw-r--r--src/ucl/src/ucl_emitter.c2
-rw-r--r--src/ucl/utils/chargen.c4
-rw-r--r--src/ucl/utils/objdump.c13
4 files changed, 12 insertions, 9 deletions
diff --git a/src/ucl/include/ucl.h b/src/ucl/include/ucl.h
index 0f132a375..fe56a04da 100644
--- a/src/ucl/include/ucl.h
+++ b/src/ucl/include/ucl.h
@@ -31,8 +31,8 @@
#include <stdbool.h>
#include <stdarg.h>
#include <stdio.h>
-#include "config.h"
+#include "config.h"
#include "uthash.h"
#include "utlist.h"
diff --git a/src/ucl/src/ucl_emitter.c b/src/ucl/src/ucl_emitter.c
index 38d4b3d18..1cf7f2798 100644
--- a/src/ucl/src/ucl_emitter.c
+++ b/src/ucl/src/ucl_emitter.c
@@ -486,7 +486,7 @@ ucl_elt_obj_write_yaml (ucl_object_t *obj, UT_string *buf, unsigned int tabs, bo
HASH_ITER (hh, obj, cur, tmp) {
ucl_add_tabs (buf, tabs + 1, is_top);
- if (obj->flags & UCL_OBJECT_NEED_KEY_ESCAPE) {
+ if (cur->flags & UCL_OBJECT_NEED_KEY_ESCAPE) {
ucl_elt_string_write_json (cur->hh.key, cur->hh.keylen, buf);
}
else {
diff --git a/src/ucl/utils/chargen.c b/src/ucl/utils/chargen.c
index 724b37899..d6fa86a20 100644
--- a/src/ucl/utils/chargen.c
+++ b/src/ucl/utils/chargen.c
@@ -98,6 +98,10 @@ main (int argc, char **argv)
i == '"' || i == '\f') {
r += print_flag ("UCL_CHARACTER_JSON_UNSAFE", &need_or, valbuf + r);
}
+ if (i == '\n' || i == '\r' || i == '\\' || i == '\b' || i == '\t' ||
+ i == '"' || i == '\f' || i == '=' || i == ':' || i == '{' || i == '[' || i == ' ') {
+ r += print_flag ("UCL_CHARACTER_UCL_UNSAFE", &need_or, valbuf + r);
+ }
if (!need_or) {
r += print_flag ("UCL_CHARACTER_DENIED", &need_or, valbuf + r);
diff --git a/src/ucl/utils/objdump.c b/src/ucl/utils/objdump.c
index 985106a09..8ba0ac261 100644
--- a/src/ucl/utils/objdump.c
+++ b/src/ucl/utils/objdump.c
@@ -95,7 +95,6 @@ main(int argc, char **argv)
const char *fn = NULL;
char inbuf[8192];
struct ucl_parser *parser;
- UT_string *err = NULL;
int k, ret = 0;
ucl_object_t *obj = NULL;
ucl_object_t *par;
@@ -118,18 +117,18 @@ main(int argc, char **argv)
parser = ucl_parser_new (0);
while (!feof (in)) {
fread (inbuf, sizeof (inbuf), 1, in);
- ucl_parser_add_chunk (parser, inbuf, strlen (inbuf), &err);
+ ucl_parser_add_chunk (parser, inbuf, strlen (inbuf));
}
fclose (in);
- if (err != NULL ) {
- printf ("Error occured: %s\n", err->d);
+ if (ucl_parser_get_error(parser) ) {
+ printf ("Error occured: %s\n", ucl_parser_get_error(parser));
ret = 1;
goto end;
}
- obj = ucl_parser_get_object (parser, &err);
- if (err != NULL ) {
- printf ("Error occured: %s\n", err->d);
+ obj = ucl_parser_get_object (parser);
+ if (ucl_parser_get_error(parser)) {
+ printf ("Error occured: %s\n", ucl_parser_get_error(parser));
ret = 1;
goto end;
}