From af038fcf186496ba07fe1cf59263b6741a0988da Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 22 Aug 2017 18:01:44 +0200 Subject: src: add include_paths to struct nft_ctx Not convenient to keep this as static for the upcoming library, so let's move it where it belongs. Signed-off-by: Pablo Neira Ayuso --- src/scanner.l | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/scanner.l') diff --git a/src/scanner.l b/src/scanner.l index b6ba32d8..d50e2b67 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -773,8 +773,8 @@ static bool search_in_include_path(const char *filename) filename[0] != '/'); } -int scanner_include_file(void *scanner, const char *filename, - const struct location *loc) +int scanner_include_file(struct nft_ctx *nft, void *scanner, + const char *filename, const struct location *loc) { struct parser_state *state = yyget_extra(scanner); struct error_record *erec; @@ -784,13 +784,13 @@ int scanner_include_file(void *scanner, const char *filename, if (search_in_include_path(filename)) { for (i = 0; i < INCLUDE_PATHS_MAX; i++) { - if (include_paths[i] == NULL) + if (nft->include_paths[i] == NULL) break; ret = snprintf(buf, sizeof(buf), "%s/%s", - include_paths[i], filename); + nft->include_paths[i], filename); if (ret < 0 || ret >= PATH_MAX) { erec = error(loc, "Too long file path \"%s/%s\"\n", - include_paths[i], filename); + nft->include_paths[i], filename); erec_queue(erec, state->msgs); return -1; } -- cgit v1.2.3