diff options
author | Jeff King <peff@peff.net> | 2017-03-20 21:22:28 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-21 11:12:53 -0700 |
commit | 116fb64e439d3744d0f244a51d7a6d714b7703ae (patch) | |
tree | ec3e23445081ec7fbb0bc5b711b5066ad83b42f5 /builtin/log.c | |
parent | prefix_filename: move docstring to header file (diff) | |
download | tgif-116fb64e439d3744d0f244a51d7a6d714b7703ae.tar.xz |
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/log.c')
-rw-r--r-- | builtin/log.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/log.c b/builtin/log.c index 281af8c1ec..bfdc7a23d3 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1084,8 +1084,7 @@ static const char *set_outdir(const char *prefix, const char *output_directory) if (!output_directory) return prefix; - return xstrdup(prefix_filename(prefix, outdir_offset, - output_directory)); + return xstrdup(prefix_filename(prefix, output_directory)); } static const char * const builtin_format_patch_usage[] = { |