From 36bdb2171f7154fcdf1a24d38c8ce3bd7e448cb1 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 10 Jan 2014 12:44:35 +0100 Subject: Replace most uses of strncmp() with prefixcmp() This is a preparation for replacing all prefix checks with either strip_prefix() or starts_with() when Git 1.8.6 is released. Signed-off-by: Lukas Fleischer --- ui-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index d32852f..2c12de7 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -120,7 +120,7 @@ const char *cgit_repobasename(const char *reponame) /* strip trailing slashes */ while (p && rvbuf[p] == '/') rvbuf[p--] = 0; /* strip trailing .git */ - if (p >= 3 && !strncmp(&rvbuf[p-3], ".git", 4)) { + if (p >= 3 && !prefixcmp(&rvbuf[p-3], ".git")) { p -= 3; rvbuf[p--] = 0; } /* strip more trailing slashes if any */ -- cgit v1.2.1