diff options
author | Jeff King <peff@peff.net> | 2017-03-21 04:22:28 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-21 21:12:53 +0300 |
commit | 116fb64e439d3744d0f244a51d7a6d714b7703ae (patch) | |
tree | ec3e23445081ec7fbb0bc5b711b5066ad83b42f5 /cache.h | |
parent | 598019769cbaa38495b0c04297efa13d0f4a572e (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 'cache.h')
-rw-r--r-- | cache.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -540,7 +540,7 @@ extern char *prefix_path_gently(const char *prefix, int len, int *remaining, con * The return value may point to static storage which will be overwritten by * further calls. */ -extern const char *prefix_filename(const char *prefix, int len, const char *path); +extern const char *prefix_filename(const char *prefix, const char *path); extern int check_filename(const char *prefix, const char *name); extern void verify_filename(const char *prefix, |