summaryrefslogtreecommitdiff
path: root/builtin/mailinfo.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-18 22:47:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-10-21 22:37:52 (GMT)
commit6e21b5089f981e0e239bee722fc0d0edec703b8a (patch)
treead9f96bd33a58a1e73ee9a7cc3b6e1a88e0d54ac /builtin/mailinfo.c
parentfbbcafd0607d6fccb2fde39c49619bcd7a7b910b (diff)
downloadgit-6e21b5089f981e0e239bee722fc0d0edec703b8a.zip
git-6e21b5089f981e0e239bee722fc0d0edec703b8a.tar.gz
git-6e21b5089f981e0e239bee722fc0d0edec703b8a.tar.bz2
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>
Diffstat (limited to 'builtin/mailinfo.c')
-rw-r--r--builtin/mailinfo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index e7edd74..a041661 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -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;
}