diff options
| author | Carlos Martín Nieto <cmn@elego.de> | 2011-05-31 17:44:55 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@elego.de> | 2011-05-31 17:57:18 +0200 |
| commit | c7e6e95841920055239b28b7dd146792895f3025 (patch) | |
| tree | b06ad4ff487452138a678e7f8b4e05311cf858d5 /src | |
| parent | 30d0550da8e73d409407fe01133628c9594d63fc (diff) | |
| download | libgit2-c7e6e95841920055239b28b7dd146792895f3025.tar.gz | |
Don't try to parse an empty config file
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Diffstat (limited to 'src')
| -rw-r--r-- | src/config_file.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/config_file.c b/src/config_file.c index 57611a762..d76c6024d 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -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.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); while (error == GIT_SUCCESS && !cfg_file->reader.eof) { |
