Merge branch 'cc/starts-n-ends-with'

Remove a few duplicate implementations of prefix/suffix comparison
functions, and rename them to starts_with and ends_with.

* cc/starts-n-ends-with:
  replace {pre,suf}fixcmp() with {starts,ends}_with()
  strbuf: introduce starts_with() and ends_with()
  builtin/remote: remove postfixcmp() and use suffixcmp() instead
  environment: normalize use of prefixcmp() by removing " != 0"
This commit is contained in:
Junio C Hamano
2013-12-17 11:47:35 -08:00
91 changed files with 484 additions and 481 deletions

View File

@ -154,7 +154,7 @@ static unsigned prefix_pathspec(struct pathspec_item *item,
magic |= pathspec_magic[i].bit;
break;
}
if (!prefixcmp(copyfrom, "prefix:")) {
if (starts_with(copyfrom, "prefix:")) {
char *endptr;
pathspec_prefix = strtol(copyfrom + 7,
&endptr, 10);