From: Hallvard Furuseth Date: Sat, 30 Nov 2002 20:00:01 +0000 (+0000) Subject: A search requesting 'cn;lang-en-' did not find 'cn;lang-en'. X-Git-Tag: NO_SLAP_OP_BLOCKS~747 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b968317900c281f742640dc7ef200cf2f30947f8;p=openldap A search requesting 'cn;lang-en-' did not find 'cn;lang-en'. --- diff --git a/servers/slapd/ad.c b/servers/slapd/ad.c index 9740fb0fdf..75a55e4769 100644 --- a/servers/slapd/ad.c +++ b/servers/slapd/ad.c @@ -385,8 +385,11 @@ static int is_ad_sublang( subdelimp = strchrlen( subp, ';', &sublen ); if( subdelimp ) subdelimp++; - if ((( suplen < sublen && supp[suplen-1] == '-' ) || - suplen == sublen ) && strncmp( supp, subp, suplen ) == 0 ) + if ( suplen > sublen + ? ( suplen-1 == sublen && supp[suplen-1] == '-' + && strncmp( supp, subp, sublen ) == 0 ) + : ( ( suplen == sublen || supp[suplen-1] == '-' ) + && strncmp( supp, subp, suplen ) == 0 ) ) { goto match; }