Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-20 12:51:22 +0300
committerJunio C Hamano <junkio@cox.net>2007-02-21 09:03:14 +0300
commitcff0302c14522ba7b34265ee39f23e6321a4777d (patch)
treed03cceec382cd4f19a1d09e9dc5f2ffbc412297a /git-compat-util.h
parent9360f27ff79df898b68ee7931c701569298d1e7e (diff)
Add prefixcmp()
We have too many strncmp(a, b, strlen(b)). Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 9863cf671f..d027c36b97 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