Skip to content

Commit

Permalink
builtin-mailinfo.c: fix confusing internal API to mailinfo()
Browse files Browse the repository at this point in the history
It fed two arguments to override the corresponding global variables,
but the caller always assigned the values to the global variables
first and then passed those global variables to this function.

Stop pretending to be a proper API to confuse people.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Aug 27, 2009
1 parent 32f4cc4 commit 606417b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions builtin-mailinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,12 +885,9 @@ static void handle_info(void)
fprintf(fout, "\n");
}

static int mailinfo(FILE *in, FILE *out, int ks, const char *encoding,
const char *msg, const char *patch)
static int mailinfo(FILE *in, FILE *out, const char *msg, const char *patch)
{
int peek;
keep_subject = ks;
metainfo_charset = encoding;
fin = in;
fout = out;

Expand Down Expand Up @@ -956,5 +953,5 @@ int cmd_mailinfo(int argc, const char **argv, const char *prefix)
if (argc != 3)
usage(mailinfo_usage);

return !!mailinfo(stdin, stdout, keep_subject, metainfo_charset, argv[1], argv[2]);
return !!mailinfo(stdin, stdout, argv[1], argv[2]);
}

0 comments on commit 606417b

Please sign in to comment.