summaryrefslogtreecommitdiff
path: root/help.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-01-14 10:29:13 +0100
committerDavid Sterba <dsterba@suse.com>2016-01-14 11:07:10 +0100
commitc26dc1ef339c373c59a7c1626bb21d64811476ee (patch)
tree3ac44d54092e4c16bba58193f42056f7ca5ade1a /help.c
parent3f248d2431424e79445131514c5f558a14a2b9f2 (diff)
btrfs-progs: move prefixcmp to utils
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'help.c')
-rw-r--r--help.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/help.c b/help.c
index 1afc09d..c8bb720 100644
--- a/help.c
+++ b/help.c
@@ -259,3 +259,13 @@ void help_command_group(const struct cmd_group *grp, int argc, char **argv)
usage_command_group(grp, full, 0);
}
+
+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;
+}
+