From 6900ff60ef7347a8c1445853a8f4689808e0976e Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Mon, 26 Mar 2018 17:50:24 +0800 Subject: expand: Fix glibc glob(3) support It's been a while since we disabled glob(3) support by default. It appears to be working now, however, we have to change our code to detect the no-match case correctly. In particular, we need to test for GLOB_NOMAGIC | GLOB_NOCHECK instead of GLOB_MAGCHAR. Signed-off-by: Herbert Xu --- src/expand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/expand.c') diff --git a/src/expand.c b/src/expand.c index 30288db..ee077a7 100644 --- a/src/expand.c +++ b/src/expand.c @@ -1205,7 +1205,8 @@ expandmeta(str, flag) ckfree(p); switch (i) { case 0: - if (!(pglob.gl_flags & GLOB_MAGCHAR)) + if ((pglob.gl_flags & (GLOB_NOMAGIC | GLOB_NOCHECK)) == + (GLOB_NOMAGIC | GLOB_NOCHECK)) goto nometa2; addglob(&pglob); globfree(&pglob); -- cgit 1.4.1