mirror of
https://git.zx2c4.com/cgit
synced 2025-07-02 22:34:32 +02:00
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:
parent
d523dacc3b
commit
36bdb2171f
6 changed files with 20 additions and 20 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue