commit | cff0302c14522ba7b34265ee39f23e6321a4777d | [log] [tgz] |
---|---|---|
author | Junio C Hamano <junkio@cox.net> | Tue Feb 20 01:51:22 2007 -0800 |
committer | Junio C Hamano <junkio@cox.net> | Tue Feb 20 22:03:14 2007 -0800 |
tree | d03cceec382cd4f19a1d09e9dc5f2ffbc412297a | |
parent | 9360f27ff79df898b68ee7931c701569298d1e7e [diff] |
Add prefixcmp() We have too many strncmp(a, b, strlen(b)). Signed-off-by: Junio C Hamano <junkio@cox.net>
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 @@ return x; } +static inline int prefixcmp(const char *str, const char *prefix) +{ + return strncmp(str, prefix, strlen(prefix)); +} + #endif