summaryrefslogtreecommitdiffstats
path: root/libblkid/match.c
diff options
context:
space:
mode:
authorbigbiff <bigbiff@teamw.in>2015-01-02 01:44:14 +0100
committerDees Troy <dees_troy@teamw.in>2015-01-05 04:38:42 +0100
commit7b4c7a681cc4c0a53dc8a8baf4853e921cfbf5de (patch)
treefb69cb515cb4ab675d5850684cc402100b7a2a22 /libblkid/match.c
parentcrypto: remove unused libs and clean up makefile (diff)
downloadandroid_bootable_recovery-7b4c7a681cc4c0a53dc8a8baf4853e921cfbf5de.tar
android_bootable_recovery-7b4c7a681cc4c0a53dc8a8baf4853e921cfbf5de.tar.gz
android_bootable_recovery-7b4c7a681cc4c0a53dc8a8baf4853e921cfbf5de.tar.bz2
android_bootable_recovery-7b4c7a681cc4c0a53dc8a8baf4853e921cfbf5de.tar.lz
android_bootable_recovery-7b4c7a681cc4c0a53dc8a8baf4853e921cfbf5de.tar.xz
android_bootable_recovery-7b4c7a681cc4c0a53dc8a8baf4853e921cfbf5de.tar.zst
android_bootable_recovery-7b4c7a681cc4c0a53dc8a8baf4853e921cfbf5de.zip
Diffstat (limited to 'libblkid/match.c')
-rw-r--r--libblkid/match.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/libblkid/match.c b/libblkid/match.c
deleted file mode 100644
index 9be82b0cc..000000000
--- a/libblkid/match.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2011 Karel Zak <kzak@redhat.com>
- *
- * This file may be redistributed under the terms of the
- * GNU Lesser General Public License.
- */
-
-#include <string.h>
-
-#include "match.h"
-
-/*
- * match_fstype:
- * @type: filesystem type
- * @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 */
- 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;
-}