From 2c94c7915a52f8df4323c8193ec424df568f0fc1 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 19 Jan 2002 06:42:59 +0000 Subject: [PATCH] Modify ad_cmp() macro to support use as an ordering function. --- servers/slapd/proto-slap.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index f0c503b915..41594bb367 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -57,8 +57,9 @@ LDAP_SLAPD_F (AttributeDescription *) ad_dup LDAP_P(( LDAP_SLAPD_F (void) ad_destroy LDAP_P(( AttributeDescription * )); -#define ad_cmp(l,r) (((l)->ad_cname.bv_len == (r)->ad_cname.bv_len) \ - ? strcasecmp((l)->ad_cname.bv_val, (r)->ad_cname.bv_val ) : 1 ) +#define ad_cmp(l,r) (((l)->ad_cname.bv_len < (r)->ad_cname.bv_len) \ + ? -1 : (((l)->ad_cname.bv_len > (r)->ad_cname.bv_len) \ + ? strcasecmp((l)->ad_cname.bv_val, (r)->ad_cname.bv_val ) : 1 )) LDAP_SLAPD_F (int) is_ad_subtype LDAP_P(( AttributeDescription *sub, -- 2.39.5