diff options
author | Karel Zak | 2011-11-15 15:17:19 +0100 |
---|---|---|
committer | Karel Zak | 2011-11-15 15:17:19 +0100 |
commit | 12089155210f8d84054cc8413d79cd2800d26929 (patch) | |
tree | 77189501ba877049f4e6051b9fd008a57c6fc434 /libmount/src/utils.c | |
parent | libblkid: export PTMAGIC also if only PTTYPE requested (diff) | |
download | kernel-qcow2-util-linux-12089155210f8d84054cc8413d79cd2800d26929.tar.gz kernel-qcow2-util-linux-12089155210f8d84054cc8413d79cd2800d26929.tar.xz kernel-qcow2-util-linux-12089155210f8d84054cc8413d79cd2800d26929.zip |
lib,match: split match_fstype() from libmount
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/utils.c')
-rw-r--r-- | libmount/src/utils.c | 30 |
1 files changed, 1 insertions, 29 deletions
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); } |