diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-07-01 21:14:21 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-07-01 21:14:21 +0100 |
commit | e002ae90a10ee76da8c0c66427ec454ee87bd1d9 (patch) | |
tree | 33a75d350caad043ec48a62eb0d5464331588af4 | |
parent | d3baaae8ac58d493fc4528a1ea3f5f35fbeb5044 (diff) | |
download | rspamd-e002ae90a10ee76da8c0c66427ec454ee87bd1d9.tar.gz rspamd-e002ae90a10ee76da8c0c66427ec454ee87bd1d9.zip |
[Minor] Set binary flag on binary texts
-rw-r--r-- | contrib/libucl/lua_ucl.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/libucl/lua_ucl.c b/contrib/libucl/lua_ucl.c index f2d4f24d6..88cdf3664 100644 --- a/contrib/libucl/lua_ucl.c +++ b/contrib/libucl/lua_ucl.c @@ -512,6 +512,11 @@ ucl_object_lua_fromelt (lua_State *L, int idx, ucl_string_flags_t flags) if (t) { obj = ucl_object_fromstring_common(t->start, t->len, 0); + + /* Binary text */ + if (t->flags & (1u << 5u)) { + obj->flags |= UCL_OBJECT_BINARY; + } } } break; @@ -569,10 +574,10 @@ ucl_object_lua_import (lua_State *L, int idx) t = lua_type (L, idx); switch (t) { case LUA_TTABLE: - obj = ucl_object_lua_fromtable (L, idx, 0); + obj = ucl_object_lua_fromtable (L, idx, UCL_STRING_RAW); break; default: - obj = ucl_object_lua_fromelt (L, idx, 0); + obj = ucl_object_lua_fromelt (L, idx, UCL_STRING_RAW); break; } @@ -597,10 +602,10 @@ ucl_object_lua_import_escape (lua_State *L, int idx) t = lua_type (L, idx); switch (t) { case LUA_TTABLE: - obj = ucl_object_lua_fromtable (L, idx, UCL_STRING_RAW); + obj = ucl_object_lua_fromtable (L, idx, UCL_STRING_ESCAPE); break; default: - obj = ucl_object_lua_fromelt (L, idx, UCL_STRING_RAW); + obj = ucl_object_lua_fromelt (L, idx, UCL_STRING_ESCAPE); break; } |