diff options
author | Jeff King <peff@peff.net> | 2017-05-26 15:07:42 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-29 11:36:56 +0900 |
commit | d51c6ee0d4bbeaf28bcd6c5f1681d208ee75763d (patch) | |
tree | 5b282e7fa4bb1c2c700e079af3d70228472a62a1 /setup.c | |
parent | a08cbcda1782993d83cf8763a394dab24e2c52b3 (diff) | |
download | git-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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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; } |