forked from Mirrors/btrfs-progs
btrfs-progs: Remove get_argv0_buf
get_argv0_buf is used only in two functions in help.c which also has direct access to the static argv0_buf. All other references to this buffer are direct. So remove the function. No functional changes. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>master
parent
f312aff23f
commit
cfa470d5a6
9
help.c
9
help.c
|
@ -31,11 +31,6 @@
|
|||
|
||||
static char argv0_buf[ARGV0_BUF_SIZE] = "btrfs";
|
||||
|
||||
const char *get_argv0_buf(void)
|
||||
{
|
||||
return argv0_buf;
|
||||
}
|
||||
|
||||
void fixup_argv0(char **argv, const char *token)
|
||||
{
|
||||
int len = strlen(argv0_buf);
|
||||
|
@ -397,7 +392,7 @@ void usage_command_group(const struct cmd_group *grp, int full, int err)
|
|||
__attribute__((noreturn))
|
||||
void help_unknown_token(const char *arg, const struct cmd_group *grp)
|
||||
{
|
||||
fprintf(stderr, "%s: unknown token '%s'\n", get_argv0_buf(), arg);
|
||||
fprintf(stderr, "%s: unknown token '%s'\n", argv0_buf, arg);
|
||||
usage_command_group(grp, 0, 1);
|
||||
exit(1);
|
||||
}
|
||||
|
@ -407,7 +402,7 @@ void help_ambiguous_token(const char *arg, const struct cmd_group *grp)
|
|||
{
|
||||
const struct cmd_struct *cmd = grp->commands;
|
||||
|
||||
fprintf(stderr, "%s: ambiguous token '%s'\n", get_argv0_buf(), arg);
|
||||
fprintf(stderr, "%s: ambiguous token '%s'\n", argv0_buf, arg);
|
||||
fprintf(stderr, "\nDid you mean one of these ?\n");
|
||||
|
||||
for (; cmd->token; cmd++) {
|
||||
|
|
Loading…
Reference in New Issue