summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-08-13 18:59:40 -0500
committerJunio C Hamano <gitster@pobox.com>2010-08-14 19:35:38 -0700
commit78457bc0ccc1af8b9eb776a0b17986ebd50442bc (patch)
tree4db7155097fa10d0e56656c6afeef36cd4ec5c61 /git-compat-util.h
parent6ad263ce7afc6c21c3ada1691f4772993b8ae46b (diff)
downloadgit-78457bc0ccc1af8b9eb776a0b17986ebd50442bc.tar.gz
compat: add strtok_r()
Windows does not have strtok_r (and while it does have an identical strtok_s, but it is not obvious how to use it). Grab an implementation from glibc. The svn-fe tool uses strtok_r to parse paths. Acked-by: Johannes Sixt <j6t@kdbg.org> Helped-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> 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 02a73eeb66..28d6b008c1 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -312,6 +312,11 @@ extern size_t gitstrlcpy(char *, const char *, size_t);
extern uintmax_t gitstrtoumax(const char *, char **, int);
#endif
+#ifdef NO_STRTOK_R
+#define strtok_r gitstrtok_r
+extern char *gitstrtok_r(char *s, const char *delim, char **save_ptr);
+#endif
+
#ifdef NO_HSTRERROR
#define hstrerror githstrerror
extern const char *githstrerror(int herror);