mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-03 04:02:04 +00:00
btrfs-progs: move prefixcmp to utils
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
3f248d2431
commit
c26dc1ef33
9
btrfs.c
9
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)
|
||||
{
|
||||
|
10
help.c
10
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user