| * Copyright (C) 2011 Karel Zak <kzak@redhat.com> |
| * This file may be redistributed under the terms of the |
| * GNU Lesser General Public License. |
| * @pattern: filesystem name or comma delimited list of names |
| * The @pattern list of filesystem can be prefixed with a global |
| * "no" prefix to invert matching of the whole list. The "no" could |
| * also be used for individual items in the @pattern list. So, |
| * "nofoo,bar" has the same meaning as "nofoo,nobar". |
| int match_fstype(const char *type, const char *pattern) |
| int no = 0; /* negated types list */ |
| if (!strncmp(pattern, "no", 2)) { |
| /* Does type occur in types, separated by commas? */ |
| if (!strncmp(p, "no", 2) && !strncmp(p+2, type, len) && |
| (p[len+2] == 0 || p[len+2] == ',')) |
| if (strncmp(p, type, len) == 0 && (p[len] == 0 || p[len] == ',')) |