mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 00:04:03 +00:00
Initialise the config reader in config_parse
git_config_open shouldn't have to initialise variables that are only used inside config_parse and its callees. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
parent
2974aa94c3
commit
934fcf78f2
@ -86,9 +86,6 @@ int git_config_open(git_config **cfg_out, const char *path)
|
|||||||
if(error < GIT_SUCCESS)
|
if(error < GIT_SUCCESS)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
/* Initialise the reading position */
|
|
||||||
cfg->reader.read_ptr = cfg->reader.buffer.data;
|
|
||||||
|
|
||||||
error = config_parse(cfg);
|
error = config_parse(cfg);
|
||||||
if(error < GIT_SUCCESS)
|
if(error < GIT_SUCCESS)
|
||||||
git_config_free(cfg);
|
git_config_free(cfg);
|
||||||
@ -599,6 +596,10 @@ static int config_parse(git_config *cfg_file)
|
|||||||
int error = GIT_SUCCESS;
|
int error = GIT_SUCCESS;
|
||||||
char *current_section = NULL;
|
char *current_section = NULL;
|
||||||
|
|
||||||
|
/* Initialise the reading position */
|
||||||
|
cfg_file->reader.read_ptr = cfg_file->reader.buffer.data;
|
||||||
|
cfg_file->reader.eof = 0;
|
||||||
|
|
||||||
skip_bom(cfg_file);
|
skip_bom(cfg_file);
|
||||||
|
|
||||||
while (error == GIT_SUCCESS && !cfg_file->reader.eof) {
|
while (error == GIT_SUCCESS && !cfg_file->reader.eof) {
|
||||||
|
Loading…
Reference in New Issue
Block a user