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>
This commit is contained in:
parent
a08cbcda17
commit
d51c6ee0d4
5
setup.c
5
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user