Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-06-14 02:26:56 +0400
committerRussell Belfer <rb@github.com>2013-06-17 21:03:48 +0400
commitc9b18018fd537566e76308fd2fec67e483b1d201 (patch)
treeda629fad3a4b7a3f1ee2331b7b9d101f209dace2 /src/util.c
parente3b4a47c1ebd55931cb25bf5c2af821df9b0bffa (diff)
Fix some warnings
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/util.c b/src/util.c
index 8536c9513..c543a3d21 100644
--- a/src/util.c
+++ b/src/util.c
@@ -283,17 +283,14 @@ int git__strcasesort_cmp(const char *a, const char *b)
{
int cmp = 0;
- const char *orig_a = a;
- const char *orig_b = b;
-
while (*a && *b) {
- if (*a == *b)
- ;
- else if (tolower(*a) == tolower(*b)) {
+ if (*a != *b) {
+ if (tolower(*a) != tolower(*b))
+ break;
+ /* use case in sort order even if not in equivalence */
if (!cmp)
- cmp = (int)(*(const unsigned char *)a) - (int)(*(const unsigned char *)b);
- } else
- break;
+ cmp = (int)(*(const uint8_t *)a) - (int)(*(const uint8_t *)b);
+ }
++a, ++b;
}