summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-05 11:35:53 -0800
committerJunio C Hamano <gitster@pobox.com>2008-11-05 11:35:53 -0800
commita1a846a19e854a3b3baff8f55c039846880a2635 (patch)
tree0d6aebb3626cbc4204a1ec455e3b2105b4733062 /config.c
parentd95f91d9e48a88a39ac2de5bfddd9d33fd36435d (diff)
parent98b35e2c749614446b916230148d66857e8a09f3 (diff)
downloadgit-a1a846a19e854a3b3baff8f55c039846880a2635.tar.gz
Merge branch 'ar/mksnpath'
* ar/mksnpath: Use git_pathdup instead of xstrdup(git_path(...)) git_pathdup: returns xstrdup-ed copy of the formatted path Fix potentially dangerous use of git_path in ref.c Add git_snpath: a .git path formatting routine with output buffer Fix potentially dangerous uses of mkpath and git_path Fix potentially dangerous uses of mkpath and git_path Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c Add mksnpath which allows you to specify the output buffer Conflicts: builtin-revert.c
Diffstat (limited to 'config.c')
-rw-r--r--config.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/config.c b/config.c
index b8d289d217..67cc1dcad0 100644
--- a/config.c
+++ b/config.c
@@ -649,7 +649,7 @@ int git_config(config_fn_t fn, void *data)
free(user_config);
}
- repo_config = xstrdup(git_path("config"));
+ repo_config = git_pathdup("config");
ret += git_config_from_file(fn, repo_config, data);
free(repo_config);
return ret;
@@ -889,7 +889,7 @@ int git_config_set_multivar(const char* key, const char* value,
if (config_exclusive_filename)
config_filename = xstrdup(config_exclusive_filename);
else
- config_filename = xstrdup(git_path("config"));
+ config_filename = git_pathdup("config");
/*
* Since "key" actually contains the section name and the real
@@ -1149,7 +1149,7 @@ int git_config_rename_section(const char *old_name, const char *new_name)
if (config_exclusive_filename)
config_filename = xstrdup(config_exclusive_filename);
else
- config_filename = xstrdup(git_path("config"));
+ config_filename = git_pathdup("config");
out_fd = hold_lock_file_for_update(lock, config_filename, 0);
if (out_fd < 0) {
ret = error("could not lock config file %s", config_filename);