diff --git a/sysctl.c b/sysctl.c index ee03ee90..b4e0dea7 100644 --- a/sysctl.c +++ b/sysctl.c @@ -164,11 +164,6 @@ static int ReadSetting(const char *restrict const name) { outname = xstrdup(name); slashdot(outname,'/','.'); /* change / to . */ - if (pattern && !pattern_match(outname, pattern)){ - free(outname); - return 0; - } - /* used to open the file */ tmpname = xmalloc(strlen(name)+strlen(PROC_PATH)+2); strcpy(tmpname, PROC_PATH); @@ -198,6 +193,11 @@ static int ReadSetting(const char *restrict const name) { goto out; } + if (pattern && !pattern_match(outname, pattern)){ + free(outname); + return 0; + } + fp = fopen(tmpname, "r"); if (!fp) {