btrfs-progs: move prefixcmp to utils
authorDavid Sterba <dsterba@suse.com>
Thu, 14 Jan 2016 09:29:13 +0000 (10:29 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 14 Jan 2016 10:07:10 +0000 (11:07 +0100)
Signed-off-by: David Sterba <dsterba@suse.com>
btrfs.c
help.c

diff --git a/btrfs.c b/btrfs.c
index 14b556b..cc70515 100644 (file)
--- a/btrfs.c
+++ b/btrfs.c
@@ -37,15 +37,6 @@ static inline const char *skip_prefix(const char *str, const char *prefix)
        return strncmp(str, prefix, len) ? NULL : str + len;
 }
 
-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;
-}
-
 static int parse_one_token(const char *arg, const struct cmd_group *grp,
                           const struct cmd_struct **cmd_ret)
 {
diff --git a/help.c b/help.c
index 1afc09d..c8bb720 100644 (file)
--- 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;
+}
+