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: 4f37161a8f: ("util/xmlconfig: Indent to Mesa style.")

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7018>
This commit is contained in:
Mike Blumenkrantz 2020-10-05 21:21:16 -04:00 committed by Marge Bot
parent a0c13c9de9
commit 2b977adff8

View file

@ -948,7 +948,7 @@ scandir_filter(const struct dirent *ent)
#endif #endif
int len = strlen(ent->d_name); int len = strlen(ent->d_name);
if (len > 5 && strcmp(ent->d_name + len - 5, ".conf") == 0) if (len <= 5 || strcmp(ent->d_name + len - 5, ".conf"))
return 0; return 0;
return 1; return 1;