Skip to content

Commit 6e21b50

Browse files
committed
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 <[email protected]>
1 parent fbbcafd commit 6e21b50

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

builtin/mailinfo.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ static FILE *cmitmsg, *patchfile, *fin, *fout;
1212
static int keep_subject;
1313
static int keep_non_patch_brackets_in_subject;
1414
static const char *metainfo_charset;
15-
static struct strbuf line = STRBUF_INIT;
1615
static struct strbuf name = STRBUF_INIT;
1716
static struct strbuf email = STRBUF_INIT;
1817
static char *message_id;
@@ -964,6 +963,8 @@ static void handle_info(void)
964963
static int mailinfo(FILE *in, FILE *out, const char *msg, const char *patch)
965964
{
966965
int peek;
966+
struct strbuf line = STRBUF_INIT;
967+
967968
fin = in;
968969
fout = out;
969970

@@ -995,7 +996,7 @@ static int mailinfo(FILE *in, FILE *out, const char *msg, const char *patch)
995996
fclose(patchfile);
996997

997998
handle_info();
998-
999+
strbuf_release(&line);
9991000
return 0;
10001001
}
10011002

0 commit comments

Comments
 (0)