summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/config.c b/config.c
index f9c400a..55313fc 100644
--- a/config.c
+++ b/config.c
@@ -1833,9 +1833,10 @@ static int git_config_from_blob_ref(config_fn_t fn,
char *git_system_config(void)
{
char *system_config = xstrdup_or_null(getenv("GIT_CONFIG_SYSTEM"));
- if (system_config)
- return system_config;
- return system_path(ETC_GITCONFIG);
+ if (!system_config)
+ system_config = system_path(ETC_GITCONFIG);
+ normalize_path_copy(system_config, system_config);
+ return system_config;
}
void git_global_config(char **user_out, char **xdg_out)
@@ -3051,7 +3052,8 @@ int git_config_set_multivar_in_file_gently(const char *config_filename,
if (contents == MAP_FAILED) {
if (errno == ENODEV && S_ISDIR(st.st_mode))
errno = EISDIR;
- error_errno(_("unable to mmap '%s'"), config_filename);
+ error_errno(_("unable to mmap '%s'%s"),
+ config_filename, mmap_os_err());
ret = CONFIG_INVALID_FILE;
contents = NULL;
goto out_free;