From: Christian Couder Date: Sat, 09 Nov 2013 07:06:20 GMT Subject: [PATCH 27/86] setup: replace prefixcmd() with has_prefix() Message-ID: <20131109070720.18178.85578.chriscool@tuxfamily.org> In-Reply-To: <20131109070358.18178.40248.chriscool@tuxfamily.org> Signed-off-by: Christian Couder --- setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.c b/setup.c index f08dd64..6ed292a 100644 --- a/setup.c +++ b/setup.c @@ -82,7 +82,7 @@ int check_filename(const char *prefix, const char *arg) const char *name; struct stat st; - if (!prefixcmp(arg, ":/")) { + if (has_prefix(arg, ":/")) { if (arg[2] == '\0') /* ":/" is root dir, always exists */ return 1; name = arg + 2; @@ -307,7 +307,7 @@ const char *read_gitfile(const char *path) if (len != st.st_size) die("Error reading %s", path); buf[len] = '\0'; - if (prefixcmp(buf, "gitdir: ")) + if (!has_prefix(buf, "gitdir: ")) die("Invalid gitfile format: %s", path); while (buf[len - 1] == '\n' || buf[len - 1] == '\r') len--; -- 1.8.4.1.566.geca833c