]> git.sur5r.net Git - openldap/commitdiff
A search requesting 'cn;lang-en-' did not find 'cn;lang-en'.
authorHallvard Furuseth <hallvard@openldap.org>
Sat, 30 Nov 2002 20:00:01 +0000 (20:00 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Sat, 30 Nov 2002 20:00:01 +0000 (20:00 +0000)
servers/slapd/ad.c

index 9740fb0fdf0468d093a9e9a54b19a8bfc922acf8..75a55e4769950ff299faca0ed19b0b65c910b3fd 100644 (file)
@@ -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;
                        }