diff --git a/strbuf.c b/strbuf.c
index b9b194b3200e950cfdb3c696d92ece0657e9d344..5efcfc8860a82766b53a0d579fbdd0844d0f9b62 100644 (file)
--- a/strbuf.c
+++ b/strbuf.c
#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