vendor/libgit2/src/config_file.h in rugged-0.19.0 vs vendor/libgit2/src/config_file.h in rugged-0.21.0
- old
+ new
@@ -14,11 +14,12 @@
return cfg->open(cfg, level);
}
GIT_INLINE(void) git_config_file_free(git_config_backend *cfg)
{
- cfg->free(cfg);
+ if (cfg)
+ cfg->free(cfg);
}
GIT_INLINE(int) git_config_file_get_string(
const git_config_entry **out, git_config_backend *cfg, const char *name)
{
@@ -40,19 +41,19 @@
GIT_INLINE(int) git_config_file_foreach(
git_config_backend *cfg,
int (*fn)(const git_config_entry *entry, void *data),
void *data)
{
- return cfg->foreach(cfg, NULL, fn, data);
+ return git_config_backend_foreach_match(cfg, NULL, fn, data);
}
GIT_INLINE(int) git_config_file_foreach_match(
git_config_backend *cfg,
const char *regexp,
int (*fn)(const git_config_entry *entry, void *data),
void *data)
{
- return cfg->foreach(cfg, regexp, fn, data);
+ return git_config_backend_foreach_match(cfg, regexp, fn, data);
}
extern int git_config_file_normalize_section(char *start, char *end);
#endif