OSDN Git Service

Move match_option() to libexfat/utils.c.
[android-x86/external-exfat.git] / libexfat / utils.c
index ba2cf8d..3a1154e 100644 (file)
@@ -178,3 +178,15 @@ void exfat_print_info(const struct exfat_super_block* sb,
        exfat_humanize_bytes(avail_space, &hb);
        printf("Available space      %10"PRIu64" %s\n", hb.value, hb.unit);
 }
+
+bool exfat_match_option(const char* options, const char* option_name)
+{
+       const char* p;
+       size_t length = strlen(option_name);
+
+       for (p = strstr(options, option_name); p; p = strstr(p + 1, option_name))
+               if ((p == options || p[-1] == ',') &&
+                               (p[length] == ',' || p[length] == '\0'))
+                       return true;
+       return false;
+}