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 <cgit@cryptocrack.de>
此提交包含在:
Lukas Fleischer
2014-01-10 12:44:35 +01:00
提交者 Jason A. Donenfeld
父節點 d523dacc3b
當前提交 36bdb2171f
共有 6 個檔案被更改,包括 20 行新增20 行删除

查看文件

@ -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 */