mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 15:10:02 +00:00
Don't try to parse an empty config file
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
parent
30d0550da8
commit
c7e6e95841
@ -802,6 +802,10 @@ static int config_parse(diskfile_backend *cfg_file)
|
|||||||
cfg_file->reader.read_ptr = cfg_file->reader.buffer.data;
|
cfg_file->reader.read_ptr = cfg_file->reader.buffer.data;
|
||||||
cfg_file->reader.eof = 0;
|
cfg_file->reader.eof = 0;
|
||||||
|
|
||||||
|
/* If the file is empty, there's nothing for us to do */
|
||||||
|
if (*cfg_file->reader.read_ptr == '\0')
|
||||||
|
return GIT_SUCCESS;
|
||||||
|
|
||||||
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