summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2007-11-09 00:49:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-09 09:30:07 (GMT)
commit659c69cfef984e7416decc78841877207e9d5914 (patch)
tree498655e05588d18d81836f94ecd0de177ef610a6 /git-compat-util.h
parentc238dad407aec1ccf6e364f9c95e10e7f84eac8f (diff)
downloadgit-659c69cfef984e7416decc78841877207e9d5914.zip
git-659c69cfef984e7416decc78841877207e9d5914.tar.gz
git-659c69cfef984e7416decc78841877207e9d5914.tar.bz2
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 <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 7b29d1b..e72654b 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)