summaryrefslogtreecommitdiff
path: root/builtin/apply.c
diff options
context:
space:
mode:
authorLibravatar Elia Pinto <gitter.spiros@gmail.com>2014-01-29 05:30:27 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-01-31 10:44:04 -0800
commite36f3a8a6fa1a1d99fb5730cd7642ecd0854b564 (patch)
treecd9a6646492793094c5a1669c96c3dbf5abfde4e /builtin/apply.c
parentbisect.c: reduce scope of variable (diff)
downloadtgif-e36f3a8a6fa1a1d99fb5730cd7642ecd0854b564.tar.xz
builtin/apply.c: reduce scope of variables
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/apply.c')
-rw-r--r--builtin/apply.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/apply.c b/builtin/apply.c
index ef32e4f624..154c63fcbb 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -1943,13 +1943,7 @@ static int parse_chunk(char *buffer, unsigned long size, struct patch *patch)
size - offset - hdrsize, patch);
if (!patchsize) {
- static const char *binhdr[] = {
- "Binary files ",
- "Files ",
- NULL,
- };
static const char git_binary[] = "GIT binary patch\n";
- int i;
int hd = hdrsize + offset;
unsigned long llen = linelen(buffer + hd, size - hd);
@@ -1965,6 +1959,12 @@ static int parse_chunk(char *buffer, unsigned long size, struct patch *patch)
patchsize = 0;
}
else if (!memcmp(" differ\n", buffer + hd + llen - 8, 8)) {
+ static const char *binhdr[] = {
+ "Binary files ",
+ "Files ",
+ NULL,
+ };
+ int i;
for (i = 0; binhdr[i]; i++) {
int len = strlen(binhdr[i]);
if (len < size - hd &&