summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 5aab60d3..d2489e70 100644
--- a/utils.c
+++ b/utils.c
@@ -2305,6 +2305,15 @@ int string_is_numerical(const char *str)
return 1;
}
+int prefixcmp(const char *str, const char *prefix)
+{
+ for (; ; str++, prefix++)
+ if (!*prefix)
+ return 0;
+ else if (*str != *prefix)
+ return (unsigned char)*prefix - (unsigned char)*str;
+}
+
/* Subvolume helper functions */
/*
* test if name is a correct subvolume name