From 659c69cfef984e7416decc78841877207e9d5914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Fri, 9 Nov 2007 01:49:36 +0100 Subject: Add strchrnul() As suggested by Pierre Habouzit, add strchrnul(). It's a useful GNU extension and can simplify string parser code. There are several places in git that can be converted to strchrnul(); as a trivial example, this patch introduces its usage to builtin-fetch--tool.c. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- git-compat-util.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'git-compat-util.h') diff --git a/git-compat-util.h b/git-compat-util.h index 7b29d1b905..e72654bc40 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -183,6 +183,11 @@ void *gitmemmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen); #endif +#ifdef NO_STRCHRNUL +#define strchrnul gitstrchrnul +char *gitstrchrnul(const char *s, int c); +#endif + extern void release_pack_memory(size_t, int); static inline char* xstrdup(const char *str) -- cgit v1.2.1