Skip to content

Commit

Permalink
btrfs-progs: move prefixcmp to utils
Browse files Browse the repository at this point in the history
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed Jan 14, 2016
1 parent 3f248d2 commit c26dc1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 0 additions & 9 deletions btrfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
10 changes: 10 additions & 0 deletions help.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit c26dc1e

Please sign in to comment.