From cbd8cf7829919f38895f25c0851afe1f13395f39 Mon Sep 17 00:00:00 2001 From: Jaromir Capik Date: Thu, 28 Aug 2014 15:48:29 +0200 Subject: [PATCH] sysctl: finalizing the GLOB_* flags check This commit properly resolves the merge conflict caused by the following two commits: fb6d4e6cb42ffacfbe300021f062b5057ba7015d f8128568d671d2c07b7d2faf0bc399fb9b7bd69e --- sysctl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sysctl.c b/sysctl.c index 08d5641f..dcf3a710 100644 --- a/sysctl.c +++ b/sysctl.c @@ -500,16 +500,21 @@ static int Preload(const char *restrict const filename) char *name, *value; glob_t globbuf; int globerr; + int globflg; int j; + globflg = GLOB_NOCHECK; +#ifdef GLOB_BRACE + globflg |= GLOB_BRACE; +#endif #ifdef GLOB_TILDE - globerr = glob(filename, GLOB_NOCHECK | GLOB_TILDE | GLOB_BRACE, NULL, &globbuf); + globflg |= GLOB_TILDE; #else if (filename[0] == '~') xwarnx(_("GLOB_TILDE is not supported on your platform, " "the tilde in \"%s\" won't be expanded."), filename); - globerr = glob(filename, GLOB_NOCHECK, NULL, &globbuf); #endif + globerr = glob(filename, globflg, NULL, &globbuf); if (globerr != 0 && globerr != GLOB_NOMATCH) xerr(EXIT_FAILURE, _("glob failed")); -- 2.40.0