Pattern matching support in `sysctl: implement --pattern option'
commit did not work when variable path was defined, for example
$ sysctl net.ipv4 -r arp.ignore
gave no output. Reason being was tht the pattern was matched agains
the specified argument and not the output variable list.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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);
goto out;
}
+ if (pattern && !pattern_match(outname, pattern)){
+ free(outname);
+ return 0;
+ }
+
fp = fopen(tmpname, "r");
if (!fp) {