Browse Source

Add prefixcmp()

We have too many strncmp(a, b, strlen(b)).

Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Junio C Hamano 18 years ago
parent
commit
cff0302c14
  1. 5
      git-compat-util.h

5
git-compat-util.h

@ -279,4 +279,9 @@ static inline int sane_case(int x, int high) @@ -279,4 +279,9 @@ static inline int sane_case(int x, int high)
return x;
}

static inline int prefixcmp(const char *str, const char *prefix)
{
return strncmp(str, prefix, strlen(prefix));
}

#endif

Loading…
Cancel
Save