mailinfo: move global "line" into mailinfo() function

With the previous steps, it becomes clear that the mailinfo()
function is the only one that wants the "line" to be directly
touchable.  Move it to the function scope of this function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2015-10-18 15:47:02 -07:00
parent fbbcafd060
commit 6e21b5089f

View file

@ -12,7 +12,6 @@ static FILE *cmitmsg, *patchfile, *fin, *fout;
static int keep_subject;
static int keep_non_patch_brackets_in_subject;
static const char *metainfo_charset;
static struct strbuf line = STRBUF_INIT;
static struct strbuf name = STRBUF_INIT;
static struct strbuf email = STRBUF_INIT;
static char *message_id;
@ -964,6 +963,8 @@ static void handle_info(void)
static int mailinfo(FILE *in, FILE *out, const char *msg, const char *patch)
{
int peek;
struct strbuf line = STRBUF_INIT;
fin = in;
fout = out;
@ -995,7 +996,7 @@ static int mailinfo(FILE *in, FILE *out, const char *msg, const char *patch)
fclose(patchfile);
handle_info();
strbuf_release(&line);
return 0;
}