aboutsummaryrefslogtreecommitdiffstats
path: root/setup.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-05-26 15:07:42 -0400
committerJunio C Hamano <gitster@pobox.com>2017-05-29 11:36:56 +0900
commitd51c6ee0d4bbeaf28bcd6c5f1681d208ee75763d (patch)
tree5b282e7fa4bb1c2c700e079af3d70228472a62a1 /setup.c
parenta08cbcda1782993d83cf8763a394dab24e2c52b3 (diff)
downloadgit-d51c6ee0d4bbeaf28bcd6c5f1681d208ee75763d.tar.gz
check_filename(): use skip_prefix
This avoids some magic numbers (and we'll be adding more similar calls in a minute). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/setup.c b/setup.c
index 000ffa810e..f2a8070bd4 100644
--- a/setup.c
+++ b/setup.c
@@ -137,10 +137,9 @@ int check_filename(const char *prefix, const char *arg)
char *to_free = NULL;
struct stat st;
- if (starts_with(arg, ":/")) {
- if (arg[2] == '\0') /* ":/" is root dir, always exists */
+ if (skip_prefix(arg, ":/", &arg)) {
+ if (!*arg) /* ":/" is root dir, always exists */
return 1;
- arg += 2;
prefix = NULL;
}