Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-19 01:47:02 +0300
committerJunio C Hamano <gitster@pobox.com>2015-10-22 01:37:52 +0300
commit6e21b5089f981e0e239bee722fc0d0edec703b8a (patch)
treead9f96bd33a58a1e73ee9a7cc3b6e1a88e0d54ac /builtin/mailinfo.c
parentfbbcafd0607d6fccb2fde39c49619bcd7a7b910b (diff)
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 e7edd743ce..a0416610c9 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;
}