@@ -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);
@@ -349,7 +344,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);
}
@@ -359,7 +354,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++) {
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> --- help.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)