Skip to content

Commit e36f3a8

Browse files
devzero2000gitster
authored andcommitted
builtin/apply.c: reduce scope of variables
Signed-off-by: Elia Pinto <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4824d1b commit e36f3a8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

builtin/apply.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,13 +1943,7 @@ static int parse_chunk(char *buffer, unsigned long size, struct patch *patch)
19431943
size - offset - hdrsize, patch);
19441944

19451945
if (!patchsize) {
1946-
static const char *binhdr[] = {
1947-
"Binary files ",
1948-
"Files ",
1949-
NULL,
1950-
};
19511946
static const char git_binary[] = "GIT binary patch\n";
1952-
int i;
19531947
int hd = hdrsize + offset;
19541948
unsigned long llen = linelen(buffer + hd, size - hd);
19551949

@@ -1965,6 +1959,12 @@ static int parse_chunk(char *buffer, unsigned long size, struct patch *patch)
19651959
patchsize = 0;
19661960
}
19671961
else if (!memcmp(" differ\n", buffer + hd + llen - 8, 8)) {
1962+
static const char *binhdr[] = {
1963+
"Binary files ",
1964+
"Files ",
1965+
NULL,
1966+
};
1967+
int i;
19681968
for (i = 0; binhdr[i]; i++) {
19691969
int len = strlen(binhdr[i]);
19701970
if (len < size - hd &&

0 commit comments

Comments
 (0)