mirror of
https://github.com/git/git.git
synced 2024-11-28 04:23:30 +08:00
Another config file parsing fix.
If the variable we need to store should go into a section that currently only has a single variable (not matching the one we're trying to insert), we will already be into the next section before we notice we've bypassed the correct location to insert the variable. To handle this case we store the current location as soon as we find a variable matching the section of our new variable. This breakage was brought up by Linus. Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
618faa1dc7
commit
bdf0ef0824
4
config.c
4
config.c
@ -336,8 +336,10 @@ static int store_aux(const char* key, const char* value)
|
||||
store.state = KEY_SEEN;
|
||||
store.seen++;
|
||||
} else if (strrchr(key, '.') - key == store.baselen &&
|
||||
!strncmp(key, store.key, store.baselen))
|
||||
!strncmp(key, store.key, store.baselen)) {
|
||||
store.state = SECTION_SEEN;
|
||||
store.offset[store.seen] = ftell(config_file);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user