From 208e09747c242ab5bd59a658033db49efa8d8696 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 3 May 2004 14:51:26 +0000 Subject: r456: - added -i option to ldbsearch - fixed sorting bug in ldb index handing (This used to be commit cdd48e2b9b3ca6be5503eec401e09db162408ac8) --- source4/lib/ldb/common/ldb.c | 2 +- source4/lib/ldb/common/util.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/lib/ldb/common') diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index ac77f306e9..ce21d1d9e2 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -81,7 +81,7 @@ int ldb_search(struct ldb_context *ldb, const char *base, enum ldb_scope scope, const char *expression, - char * const attrs[], struct ldb_message ***res) + const char * const *attrs, struct ldb_message ***res) { return ldb->ops->search(ldb, base, scope, expression, attrs, res); } diff --git a/source4/lib/ldb/common/util.c b/source4/lib/ldb/common/util.c index 534d07c1df..22bbc8334e 100644 --- a/source4/lib/ldb/common/util.c +++ b/source4/lib/ldb/common/util.c @@ -85,10 +85,13 @@ int list_find(const void *needle, } return test_i; } - if (r == -1) { + if (r < 0) { + if (test_i == 0) { + return -1; + } max_i = test_i - 1; } - if (r == 1) { + if (r > 0) { min_i = test_i + 1; } } -- cgit