aboutsummaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-16 11:25:59 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-16 11:26:00 -0700
commit6e4094731acee5207595a8416d19508107ea475d (patch)
treea04d3fe754e34c91216f3a5e2f5450a705fd969d /strbuf.c
parentd518cc0a56b8b22a5d085be8710f082dbabfe1b3 (diff)
parent47bf4b0fc52f3ad5823185a85f5f82325787c84b (diff)
downloadgit-6e4094731acee5207595a8416d19508107ea475d.tar.gz
git-6e4094731acee5207595a8416d19508107ea475d.tar.xz
Merge branch 'jk/strip-suffix'
* jk/strip-suffix: prepare_packed_git_one: refactor duplicate-pack check verify-pack: use strbuf_strip_suffix strbuf: implement strbuf_strip_suffix index-pack: use strip_suffix to avoid magic numbers use strip_suffix instead of ends_with in simple cases replace has_extension with ends_with implement ends_with via strip_suffix add strip_suffix function sha1_file: replace PATH_MAX buffer with strbuf in prepare_packed_git_one()
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/strbuf.c b/strbuf.c
index 12c78656c..33018d847 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -11,15 +11,6 @@ int starts_with(const char *str, const char *prefix)
return 0;
}
-int ends_with(const char *str, const char *suffix)
-{
- int len = strlen(str), suflen = strlen(suffix);
- if (len < suflen)
- return 0;
- 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