summaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2013-12-01 08:49:18 +0100
committerJunio C Hamano <gitster@pobox.com>2013-12-05 14:13:56 -0800
commit666c90b6290dae0f4d3672a2b0caf6dea67dd1e3 (patch)
tree007725bca1f345c85340cefa242ba28b4325e680 /strbuf.c
parent59556548230e617b837343c2c07e357e688e2ca4 (diff)
downloadgit-666c90b6290dae0f4d3672a2b0caf6dea67dd1e3.tar.gz
strbuf: remove prefixcmp() and suffixcmp()cc/starts-n-ends-with-endgame
As starts_with() and ends_with() have been used to replace prefixcmp() and suffixcmp() respectively, we can now remove them. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/strbuf.c b/strbuf.c
index 83caf4a914..ee96dcfb81 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -10,15 +10,6 @@ int starts_with(const char *str, const char *prefix)
return 0;
}
-int prefixcmp(const char *str, const char *prefix)
-{
- for (; ; str++, prefix++)
- if (!*prefix)
- return 0;
- else if (*str != *prefix)
- return (unsigned char)*prefix - (unsigned char)*str;
-}
-
int ends_with(const char *str, const char *suffix)
{
int len = strlen(str), suflen = strlen(suffix);
@@ -28,15 +19,6 @@ int ends_with(const char *str, const char *suffix)
return !strcmp(str + len - suflen, suffix);
}
-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