Skip to content

Commit

Permalink
git-archive: inline default_parse_extra()
Browse files Browse the repository at this point in the history
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Rene Scharfe authored and Junio C Hamano committed Sep 14, 2006
1 parent d751864 commit 2232c0c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions builtin-archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,6 @@ void parse_treeish_arg(const char **argv, struct archiver_args *ar_args,
ar_args->time = archive_time;
}

static const char *default_parse_extra(struct archiver *ar,
const char **argv)
{
static char msg[64];

snprintf(msg, sizeof(msg) - 4, "'%s' format does not handle %s",
ar->name, *argv);

return strcat(msg, "...");
}

int parse_archive_args(int argc, const char **argv, struct archiver *ar)
{
const char *extra_argv[MAX_EXTRA_ARGS];
Expand Down Expand Up @@ -208,7 +197,8 @@ int parse_archive_args(int argc, const char **argv, struct archiver *ar)

if (extra_argc) {
if (!ar->parse_extra)
die("%s", default_parse_extra(ar, extra_argv));
die("'%s' format does not handle %s",
ar->name, extra_argv[0]);
ar->args.extra = ar->parse_extra(extra_argc, extra_argv);
}
ar->args.verbose = verbose;
Expand Down

0 comments on commit 2232c0c

Please sign in to comment.