From 12089155210f8d84054cc8413d79cd2800d26929 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 15 Nov 2011 15:17:19 +0100 Subject: lib,match: split match_fstype() from libmount Signed-off-by: Karel Zak --- libmount/src/utils.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'libmount/src/utils.c') diff --git a/libmount/src/utils.c b/libmount/src/utils.c index 239e587fe..7cd50ec3a 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -245,35 +245,7 @@ int mnt_fstype_is_netfs(const char *type) */ int mnt_match_fstype(const char *type, const char *pattern) { - int no = 0; /* negated types list */ - int len; - const char *p; - - if (!pattern && !type) - return 1; - if (!pattern) - return 0; - - if (!strncmp(pattern, "no", 2)) { - no = 1; - pattern += 2; - } - - /* Does type occur in types, separated by commas? */ - len = strlen(type); - p = pattern; - while(1) { - if (!strncmp(p, "no", 2) && !strncmp(p+2, type, len) && - (p[len+2] == 0 || p[len+2] == ',')) - return 0; - if (strncmp(p, type, len) == 0 && (p[len] == 0 || p[len] == ',')) - return !no; - p = strchr(p,','); - if (!p) - break; - p++; - } - return no; + return match_fstype(type, pattern); } -- cgit v1.2.3-55-g7522