X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=strbuf.c;h=5efcfc8860a82766b53a0d579fbdd0844d0f9b62;hb=472fa4cd33c690dd9b338c02af3ed135666aea43;hp=b9b194b3200e950cfdb3c696d92ece0657e9d344;hpb=9f4c4eb0e16d1e21eaaf5cab5591c3491456cd14;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