diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-02-19 15:54:25 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-02-19 15:54:25 +0000 |
commit | 456c2f66f3e06243835d9e62b8c289265e947e61 (patch) | |
tree | 82d4a939c078e69eb624f90633b4bcddb209797b | |
parent | d7cddc0f8c2ff449a3341b399df4c32ad7ea9803 (diff) | |
download | rspamd-456c2f66f3e06243835d9e62b8c289265e947e61.tar.gz rspamd-456c2f66f3e06243835d9e62b8c289265e947e61.zip |
[Minor] Add ability to skip setting of file vars in UCL
-rw-r--r-- | contrib/libucl/ucl.h | 3 | ||||
-rw-r--r-- | contrib/libucl/ucl_parser.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/contrib/libucl/ucl.h b/contrib/libucl/ucl.h index ee683b163..ee03334e0 100644 --- a/contrib/libucl/ucl.h +++ b/contrib/libucl/ucl.h @@ -154,7 +154,8 @@ typedef enum ucl_parser_flags { UCL_PARSER_NO_TIME = (1 << 2), /**< Do not parse time and treat time values as strings */ UCL_PARSER_NO_IMPLICIT_ARRAYS = (1 << 3), /** Create explicit arrays instead of implicit ones */ UCL_PARSER_SAVE_COMMENTS = (1 << 4), /** Save comments in the parser context */ - UCL_PARSER_DISABLE_MACRO = (1 << 5) /** Treat macros as comments */ + UCL_PARSER_DISABLE_MACRO = (1 << 5), /** Treat macros as comments */ + UCL_PARSER_NO_FILEVARS = (1 << 6) /** Do not set file vars */ } ucl_parser_flags_t; /** diff --git a/contrib/libucl/ucl_parser.c b/contrib/libucl/ucl_parser.c index 82c4ca24b..d6b8eb656 100644 --- a/contrib/libucl/ucl_parser.c +++ b/contrib/libucl/ucl_parser.c @@ -2461,8 +2461,10 @@ ucl_parser_new (int flags) parser->comments = ucl_object_typed_new (UCL_OBJECT); } - /* Initial assumption about filevars */ - ucl_parser_set_filevars (parser, NULL, false); + if (!(flags & UCL_PARSER_NO_FILEVARS)) { + /* Initial assumption about filevars */ + ucl_parser_set_filevars (parser, NULL, false); + } return parser; } |