Add prefixcmp()

We have too many strncmp(a, b, strlen(b)).

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2007-02-20 01:51:22 -08:00
parent 9360f27ff7
commit cff0302c14

View File

@ -279,4 +279,9 @@ static inline int sane_case(int x, int high)
return x;
}
static inline int prefixcmp(const char *str, const char *prefix)
{
return strncmp(str, prefix, strlen(prefix));
}
#endif