summaryrefslogtreecommitdiff
path: root/src/unix
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-03-08 16:39:57 -0800
committerRussell Belfer <rb@github.com>2013-03-08 16:39:57 -0800
commite40f1c2d23c3758968df94a17831ec5432ae6988 (patch)
treea634eb49add884f11c576b6a956b8b9e1d87357b /src/unix
parent9bea03ce776ed864b0556815d94d71d300ac1da3 (diff)
downloadlibgit2-e40f1c2d23c3758968df94a17831ec5432ae6988.tar.gz
Make tree iterator handle icase equivalence
There is a serious bug in the previous tree iterator implementation. If case insensitivity resulted in member elements being equivalent to one another, and those member elements were trees, then the children of the colliding elements would be processed in sequence instead of in a single flattened list. This meant that the tree iterator was not truly acting like a case-insensitive list. This completely reworks the tree iterator to manage lists with case insensitive equivalence classes and advance through the items in a unified manner in a single sorted frame. It is possible that at a future date we might want to update this to separate the case insensitive and case sensitive tree iterators so that the case sensitive one could be a minimal amount of code and the insensitive one would always know what it needed to do without checking flags. But there would be so much shared code between the two, that I'm not sure it that's a win. For now, this gets what we need. More tests are needed, though.
Diffstat (limited to 'src/unix')
-rw-r--r--src/unix/posix.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/unix/posix.h b/src/unix/posix.h
index c738b531d..f4886c5d1 100644
--- a/src/unix/posix.h
+++ b/src/unix/posix.h
@@ -8,6 +8,7 @@
#define INCLUDE_posix__w32_h__
#include <stdio.h>
+#include <sys/param.h>
#define p_lstat(p,b) lstat(p,b)
#define p_readlink(a, b, c) readlink(a, b, c)