From 2b977adff805e618d63e84d3b95755a1b186d3f2 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 5 Oct 2020 21:21:16 -0400 Subject: [PATCH] xmlconfig: fix scandir_filter this was changed from a fnmatch usage to strcmp, and the return value was flipped, breaking matching also fix the formatting of the changed lines Fixes: 4f37161a8f2: ("util/xmlconfig: Indent to Mesa style.") Reviewed-by: Eric Anholt Part-of: --- src/util/xmlconfig.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c index b54fd10001f..6505fb4015e 100644 --- a/src/util/xmlconfig.c +++ b/src/util/xmlconfig.c @@ -947,9 +947,9 @@ scandir_filter(const struct dirent *ent) return 0; #endif - int len = strlen(ent->d_name); - if (len > 5 && strcmp(ent->d_name + len - 5, ".conf") == 0) - return 0; + int len = strlen(ent->d_name); + if (len <= 5 || strcmp(ent->d_name + len - 5, ".conf")) + return 0; return 1; }