aboutsummaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-20 20:28:50 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-20 20:28:50 -0800
commitfcb2a7e4a3c7899a3432f5804889fa3ea5779220 (patch)
tree0f0785d427c23c7b8dbaae1afcdbd370ea3b639c /strbuf.c
parente98f80f50bf9b78aab8cea6184fd708259d0c3b3 (diff)
parent566c511195adc0ce88559853f2f00933e241d862 (diff)
downloadgit-fcb2a7e4a3c7899a3432f5804889fa3ea5779220.tar.gz
git-fcb2a7e4a3c7899a3432f5804889fa3ea5779220.tar.xz
Merge branch 'ap/merge-backend-opts'
* ap/merge-backend-opts: Document that merge strategies can now take their own options Extend merge-subtree tests to test -Xsubtree=dir. Make "subtree" part more orthogonal to the rest of merge-recursive. pull: Fix parsing of -X<option> Teach git-pull to pass -X<option> to git-merge git merge -X<option> git-merge-file --ours, --theirs Conflicts: git-compat-util.h
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/strbuf.c b/strbuf.c
index 67448b7b0..bc3a0802e 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -10,6 +10,15 @@ int prefixcmp(const char *str, const char *prefix)
return (unsigned char)*prefix - (unsigned char)*str;
}
+int suffixcmp(const char *str, const char *suffix)
+{
+ int len = strlen(str), suflen = strlen(suffix);
+ if (len < suflen)
+ return -1;
+ else
+ return strcmp(str + len - suflen, suffix);
+}
+
/*
* Used as the default ->buf value, so that people can always assume
* buf is non NULL and ->buf is NUL terminated even for a freshly