diff options
| author | Vicent Marti <tanoku@gmail.com> | 2013-02-20 17:09:51 +0100 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2013-02-20 17:09:51 +0100 |
| commit | 41051e3fe1bcb4099714551b61e0b7b06275557c (patch) | |
| tree | cc589e2e0dd5ae419fec07eec28830dd264e2570 /src/util.h | |
| parent | c51880eeaf80840e922309f3b5804d98ec647cc8 (diff) | |
| download | libgit2-41051e3fe1bcb4099714551b61e0b7b06275557c.tar.gz | |
signature: Shut up MSVC, you silly goose
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h index 351ff422b..9dbcb6a4f 100644 --- a/src/util.h +++ b/src/util.h @@ -127,6 +127,21 @@ GIT_INLINE(const char *) git__next_line(const char *s) return s; } +GIT_INLINE(const void *) git__memrchr(const void *s, int c, size_t n) +{ + const unsigned char *cp; + + if (n != 0) { + cp = (unsigned char *)s + n; + do { + if (*(--cp) == (unsigned char)c) + return cp; + } while (--n != 0); + } + + return NULL; +} + typedef int (*git__tsort_cmp)(const void *a, const void *b); extern void git__tsort(void **dst, size_t size, git__tsort_cmp cmp); |
