diff --git a/git-compat-util.h b/git-compat-util.h
index e72654bc408e36512b392e3e5ed3026d79cc141b..ede9408bbd14880b3534110586562c2e6df8b07b 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
const void *needle, size_t needlelen);
#endif
-#ifdef NO_STRCHRNUL
+#ifdef __GLIBC_PREREQ
+#if __GLIBC_PREREQ(2, 1)
+#define HAVE_STRCHRNUL
+#endif
+#endif
+
+#ifndef HAVE_STRCHRNUL
#define strchrnul gitstrchrnul
-char *gitstrchrnul(const char *s, int c);
+static inline char *gitstrchrnul(const char *s, int c)
+{
+ while (*s && *s != c)
+ s++;
+ return (char *)s;
+}
#endif
extern void release_pack_memory(size_t, int);