From b968317900c281f742640dc7ef200cf2f30947f8 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sat, 30 Nov 2002 20:00:01 +0000 Subject: [PATCH] A search requesting 'cn;lang-en-' did not find 'cn;lang-en'. --- servers/slapd/ad.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } -- 2.39.5