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>
This commit is contained in:
Lukas Fleischer
2014-01-10 12:44:35 +01:00
committed by Jason A. Donenfeld
父節點 d523dacc3b
當前提交 36bdb2171f
共有 6 個文件被更改,包括 20 次插入20 次删除

查看文件

@@ -105,7 +105,7 @@ static void add_repo(const char *base, struct strbuf *path, repo_config_fn fn)
return;
strbuf_setlen(path, pathlen);
if (strncmp(base, path->buf, strlen(base)))
if (prefixcmp(path->buf, base))
strbuf_addbuf(&rel, path);
else
strbuf_addstr(&rel, path->buf + strlen(base) + 1);