X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=strbuf.c;h=5efcfc8860a82766b53a0d579fbdd0844d0f9b62;hb=1b56bc9a1545902db64b8bdce48a499900acfe0b;hp=b9b194b3200e950cfdb3c696d92ece0657e9d344;hpb=9f165805f3bde8cd91653f2db1c35a4548b85625;p=git.git diff --git a/strbuf.c b/strbuf.c index b9b194b32..5efcfc886 100644 --- a/strbuf.c +++ b/strbuf.c @@ -1,5 +1,14 @@ #include "cache.h" +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; +} + /* * 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