+ size_t exclude_count = ex->exclude_count;
+
+ /* If no options are given, the default is to include. */
+ if (exclude_count == 0)
+ return false;
+ else
+ {
+ struct patopts const *exclude = ex->exclude;
+ size_t i;
+
+ /* Otherwise, the default is the opposite of the first option. */
+ bool excluded = !! (exclude[0].options & EXCLUDE_INCLUDE);
+
+ /* Scan through the options, seeing whether they change F from
+ excluded to included or vice versa. */
+ for (i = 0; i < exclude_count; i++)
+ {
+ char const *pattern = exclude[i].pattern;
+ int options = exclude[i].options;
+ if (excluded == !! (options & EXCLUDE_INCLUDE))
+ {
+ int (*matcher) (char const *, char const *, int) =
+ (options & EXCLUDE_WILDCARDS
+ ? fnmatch
+ : fnmatch_no_wildcards);
+ bool matched = ((*matcher) (pattern, f, options) == 0);
+ char const *p;