From: Junio C Hamano Date: Tue, 20 Feb 2007 09:51:22 +0000 (-0800) Subject: Add prefixcmp() X-Git-Tag: v1.5.1-rc1~274 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cff0302c14522ba7b34265ee39f23e6321a4777d;p=git.git Add prefixcmp() We have too many strncmp(a, b, strlen(b)). Signed-off-by: Junio C Hamano --- diff --git a/git-compat-util.h b/git-compat-util.h index 9863cf671..d027c36b9 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -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