diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2009-03-07 21:02:26 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-03-07 20:52:23 -0800 |
commit | fd13b21f52b499ff6fa951ce27d4b9c9f0653087 (patch) | |
tree | b59de697d0f3ce229daabd83387ab01d162a1371 /builtin-fmt-merge-msg.c | |
parent | eb3a9dd3279fe4b05f286665986ebf6d43a6ccc0 (diff) | |
download | git-fd13b21f52b499ff6fa951ce27d4b9c9f0653087.tar.gz git-fd13b21f52b499ff6fa951ce27d4b9c9f0653087.tar.xz |
Move local variables to narrower scopes
These weren't used outside and can be safely moved
Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-fmt-merge-msg.c')
-rw-r--r-- | builtin-fmt-merge-msg.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin-fmt-merge-msg.c b/builtin-fmt-merge-msg.c index df18f4070..a7883690d 100644 --- a/builtin-fmt-merge-msg.c +++ b/builtin-fmt-merge-msg.c @@ -256,8 +256,7 @@ static void shortlog(const char *name, unsigned char *sha1, int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) { int limit = 20, i = 0, pos = 0; - char line[1024]; - char *p = line, *sep = ""; + char *sep = ""; unsigned char head_sha1[20]; const char *current_branch; @@ -271,9 +270,8 @@ int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) { /* get a line */ while (pos < in->len) { int len; - char *newline; + char *newline, *p = in->buf + pos; - p = in->buf + pos; newline = strchr(p, '\n'); len = newline ? newline - p : strlen(p); pos += len + !!newline; |