summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-02-20 17:09:51 +0100
committerVicent Marti <tanoku@gmail.com>2013-02-20 17:09:51 +0100
commit41051e3fe1bcb4099714551b61e0b7b06275557c (patch)
treecc589e2e0dd5ae419fec07eec28830dd264e2570 /src/util.h
parentc51880eeaf80840e922309f3b5804d98ec647cc8 (diff)
downloadlibgit2-41051e3fe1bcb4099714551b61e0b7b06275557c.tar.gz
signature: Shut up MSVC, you silly goose
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h15
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);