commit 375688c: [Minor] UCL: Save filename when setting file vars

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Dec 27 18:28:07 UTC 2018


Author: Vsevolod Stakhov
Date: 2018-12-13 13:44:09 +0000
URL: https://github.com/rspamd/rspamd/commit/375688cd33afbd009a010d53cabc85fb20c4b5d2

[Minor] UCL: Save filename when setting file vars

---
 contrib/libucl/ucl_util.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/contrib/libucl/ucl_util.c b/contrib/libucl/ucl_util.c
index 279e9f3c6..10e5df61f 100644
--- a/contrib/libucl/ucl_util.c
+++ b/contrib/libucl/ucl_util.c
@@ -1934,6 +1934,11 @@ ucl_parser_set_filevars (struct ucl_parser *parser, const char *filename, bool n
 		ucl_parser_register_variable (parser, "FILENAME", realbuf);
 		curdir = dirname (realbuf);
 		ucl_parser_register_variable (parser, "CURDIR", curdir);
+
+		if (parser->cur_file) {
+			free (parser->cur_file);
+		}
+		parser->cur_file = strdup (filename);
 	}
 	else {
 		/* Set everything from the current dir */


More information about the Commits mailing list