From 6ae9a32cd656e4398c11e851e959a0dd85f3c072 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 11 Apr 2019 01:29:12 +0200 Subject: Android: Disable include patterns if glob is unsupported Because of missing glob() in NDK platforms before 28 --- conf/cf-lex.l | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'conf') diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 05288b1a..cd720cdf 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -27,13 +27,16 @@ %{ #undef REJECT /* Avoid name clashes */ +#include "sysdep/config.h" #include #include #include #include #include #include +#ifdef HAVE_GLOB #include +#endif #include #include #include @@ -461,7 +464,9 @@ cf_include(char *arg, int alen) struct include_file_stack *base_ifs = ifs; int new_depth, rv, i; char *patt; +#ifdef HAVE_GLOB glob_t g = {}; +#endif new_depth = ifs->depth + 1; if (new_depth > MAX_INCLUDE_DEPTH) @@ -491,6 +496,7 @@ cf_include(char *arg, int alen) return; } +#ifdef HAVE_GLOB /* Expand the pattern */ rv = glob(patt, GLOB_ERR | GLOB_NOESCAPE, NULL, &g); if (rv == GLOB_ABORTED) @@ -526,6 +532,10 @@ cf_include(char *arg, int alen) globfree(&g); enter_ifs(ifs); +#else + cf_error("Pattern match unsupported %s: %m", patt); + return; +#endif /* !HAVE_GLOB */ } static int -- cgit v1.2.3