Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-03-21 04:22:28 +0300
committerJunio C Hamano <gitster@pobox.com>2017-03-21 21:12:53 +0300
commit116fb64e439d3744d0f244a51d7a6d714b7703ae (patch)
treeec3e23445081ec7fbb0bc5b711b5066ad83b42f5 /builtin/config.c
parent598019769cbaa38495b0c04297efa13d0f4a572e (diff)
prefix_filename: drop length parameter
This function takes the prefix as a ptr/len pair, but in every caller the length is exactly strlen(ptr). Let's simplify the interface and just take the string. This saves callers specifying it (and in some cases handling a NULL prefix). In a handful of cases we had the length already without calling strlen, so this is technically slower. But it's not likely to matter (after all, if the prefix is non-empty we'll allocate and copy it into a buffer anyway). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/config.c')
-rw-r--r--builtin/config.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/builtin/config.c b/builtin/config.c
index 05843a0f96..74f6c34d11 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -528,7 +528,6 @@ int cmd_config(int argc, const char **argv, const char *prefix)
if (!is_absolute_path(given_config_source.file) && prefix)
given_config_source.file =
xstrdup(prefix_filename(prefix,
- strlen(prefix),
given_config_source.file));
}