From 116fb64e439d3744d0f244a51d7a6d714b7703ae Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 20 Mar 2017 21:22:28 -0400 Subject: 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 Signed-off-by: Junio C Hamano --- setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.c') diff --git a/setup.c b/setup.c index 64f922a93..a76379e0c 100644 --- a/setup.c +++ b/setup.c @@ -142,7 +142,7 @@ int check_filename(const char *prefix, const char *arg) return 1; name = arg + 2; } else if (prefix) - name = prefix_filename(prefix, strlen(prefix), arg); + name = prefix_filename(prefix, arg); else name = arg; if (!lstat(name, &st)) -- cgit v1.2.1