]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] UCL: Save filename when setting file vars
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 13 Dec 2018 13:44:09 +0000 (13:44 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 13 Dec 2018 13:44:09 +0000 (13:44 +0000)
contrib/libucl/ucl_util.c

index 279e9f3c669c44a25746b3dd372aee12254e2aee..10e5df61f3bfcd2de850b7eee2ba6a0f5e6fdaf8 100644 (file)
@@ -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 */