Browse Source

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>
maint
Jeff King 8 years ago committed by Junio C Hamano
parent
commit
d51c6ee0d4
  1. 5
      setup.c

5
setup.c

@ -137,10 +137,9 @@ int check_filename(const char *prefix, const char *arg) @@ -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…
Cancel
Save