From cff0302c14522ba7b34265ee39f23e6321a4777d Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 20 Feb 2007 01:51:22 -0800 Subject: 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 9863cf6..d027c36 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 -- cgit v0.10.2-6-g49f6