summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-08-08 11:15:40 -0700
committerVicent Marti <tanoku@gmail.com>2011-08-08 11:15:40 -0700
commit09df3f2c0f72dbcf206cc48f508919e03671a946 (patch)
tree38b614e07a8cbb6c37fd44095069886179c540da /src
parenta41bf612221d1b709af96b58209933653f3d1355 (diff)
downloadlibgit2-09df3f2c0f72dbcf206cc48f508919e03671a946.tar.gz
transport: Wrap `strcmp`
We don't want direct pointers to the CRT on Windows, we may get stdcall conflicts.
Diffstat (limited to 'src')
-rw-r--r--src/transport_local.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/transport_local.c b/src/transport_local.c
index bb3b10e10..350f2ea4a 100644
--- a/src/transport_local.c
+++ b/src/transport_local.c
@@ -14,6 +14,13 @@ typedef struct {
git_vector *refs;
} transport_local;
+static int cmp_refs(const void *a, const void *b)
+{
+ const char *stra = (const char *)a;
+ const char *strb = (const char *)b;
+ return strcmp(stra, strb);
+}
+
/*
* Try to open the url as a git directory. The direction doesn't
* matter in this case because we're calulating the heads ourselves.
@@ -140,7 +147,7 @@ static int local_ls(git_transport *transport, git_headarray *array)
return error;
/* Sort the references first */
- git__tsort((void **)refs.strings, refs.count, (git_vector_cmp) strcmp);
+ git__tsort((void **)refs.strings, refs.count, &cmp_refs);
/* Add HEAD */
error = add_ref(GIT_HEAD_FILE, repo, vec);